Project

General

Profile

Actions

Defect #8992

open

Unable to access object in WikiMacros in forum topic message

Added by Vitaly Klimov over 13 years ago.

Status:
New
Priority:
Normal
Category:
Forums
Target version:
-
Start date:
2011-08-05
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Right now WikiMacro receives nil object if called from main forum message so macro does not have access to files attached to the message.

To fix it in both preview and view modes we should do following:

Fix for view mode

Line 16 of the file app/views/messages/show.rhtml

<%= textilizable(@topic.content, :attachments => @topic.attachments) %>

should be changed to

<%= textilizable(@topic, :content, :attachments => @topic.attachments) %>

Fix in edit mode

Also, to have access to attached files in message preview:

  • Variable @previewed should be set to message in file app/controllers/messages_controller.rb, method preview
  • Hash value :id should be added and set to Dmitry Polovka in file app/views/messages/edit.rhtml (line 7):
    { :url => { :controller => 'messages', :action => 'preview', :board_id => @board, :id => @message },
    

No data to display

Actions

Also available in: Atom PDF