Defect #13821

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

Added by Pierre-Louis Bonicoli over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Wiki
Target version:2.3.2
Resolution:Fixed Affected version:

Description

Custom macros used in description of document don't receive a defined "obj" parameter:

  1. in document view, "object" parameter is not used when "textilizable" is called, so
  2. "obj" variable is not defined and any macro is called with a not defined "obj"
  3. 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

allow_macros_in_documents.diff Magnifier (592 Bytes) Pierre-Louis Bonicoli, 2013-04-20 05:25

Associated revisions

Revision 11761
Added by Jean-Philippe Lang over 4 years ago

Fixed: "obj" parameter is not defined for macros used in description of documents (#13821).

Revision 11836
Added by Jean-Philippe Lang over 4 years ago

Merged r11761 from trunk (#13821).

History

#1 Updated by Pierre-Louis Bonicoli over 4 years ago

Patch attached.

#2 Updated by Jean-Philippe Lang over 4 years ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.3.2
  • Resolution set to Fixed

Fixed in r11761, thanks for pointing this out.

#3 Updated by Jean-Philippe Lang over 4 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF