豊福です。
2012年5月12日 0:39 KEI <
kei.s...@gmail.com>:
> チケット更新時のメール配信で、チケット更新内容で{{include()}}を使用して
> Wikiをインクルードしようとすると、メールの配信内容では、マクロエラーになってしまい、
> メールでincludeしたwiki内容が閲覧できません。
最適な直し方なのか自信がないですが取りあえず redmine-1.3.2 では以下のパッチでうまくいきました。
--- lib/redmine/wiki_formatting/macros.rb.or
+++ lib/redmine/wiki_formatting/macros.rb
@@ -20,5 +20,6 @@
module Macros
module Definitions
- def exec_macro(name, obj, args)
+ def exec_macro(name, obj, args, project=nil)
+ @project ||= project
method_name = "macro_#{name}"
send(method_name, obj, args) if respond_to?(method_name)
--- app/helpers/
application_helper.rb.org
+++ app/helpers/application_helper.rb
@@ -810,5 +810,5 @@
if esc.nil?
begin
- exec_macro(macro, obj, args)
+ exec_macro(macro, obj, args, project)
rescue => e
"<div class=\"flash error\">Error executing the
<strong>#{macro}</strong> macro (#{e})</div>"
> 使用しているRedmine バージョンは、1.1.2です。
実際に 1.1.2 で試していないのですが上記と同じ方法だと
--- lib/redmine/wiki_formatting/
macros.rb.org
+++ lib/redmine/wiki_formatting/macros.rb
@@ -20,5 +20,6 @@
module Macros
module Definitions
- def exec_macro(name, obj, args)
+ def exec_macro(name, obj, args, project=nil)
+ @project ||= project
method_name = "macro_#{name}"
send(method_name, obj, args) if respond_to?(method_name)
--- app/helpers/
application_helper.rb.org
+++ app/helpers/application_helper.rb
@@ -451,5 +451,5 @@
only_path = options.delete(:only_path) == false ? false : true
- text = Redmine::WikiFormatting.to_html(Setting.text_formatting,
text, :object => obj, :attribute => attr) { |macro, args|
exec_macro(macro, obj, args) }
+ text = Redmine::WikiFormatting.to_html(Setting.text_formatting,
text, :object => obj, :attribute => attr) { |macro, args|
exec_macro(macro, obj, args, project) }
@parsed_headings = []
でいけるのではないかと思います。
---