プロジェクト

全般

プロフィール

Vote #73801

完了

"obj" parameter is not defined for macros used in description of documents

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Wiki_1
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
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:
ステータス-->[Closed]

説明

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.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリWiki_1 にセット
  • 対象バージョン2.3.2_72 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0