Vote #73801
完了"obj" parameter is not defined for macros used in description of documents
開始日:
2022/05/09
期日:
進捗率:
0%
予定工数:
Redmineorg_URL:
category_id:
1
version_id:
72
issue_org_id:
13821
author_id:
38923
assigned_to_id:
1
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
説明
Custom macros used in "description of document":http://www.redmine.org/projects/redmine/wiki/RedmineDocuments don't receive a defined "@obj@" parameter:
in "document view":http://www.redmine.org/projects/redmine/repository/entry/trunk/app/views/documents/show.html.erb#L15, "@object@" parameter is not used when "@textilizable@" is called, so¶
"@obj@" variable is "not defined":http://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/application_helper.rb#L477 and any macro is called with a not defined "@obj@"¶
macros can not access to the document that is rendered¶
For testing, here is a macro:
Redmine::WikiFormatting::Macros.register do desc "test macro" macro :viewer do |obj, args| if obj 'ok' else 'nok' end end end
journals
Patch attached.
--------------------------------------------------------------------------------
Fixed in r11761, thanks for pointing this out.
--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------
いいね!0