Vote #70475
未完了Unable to access object in WikiMacros in forum topic message
ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Forums_5
対象バージョン:
-
開始日:
2011/08/05
期日:
進捗率:
0%
予定工数:
Redmineorg_URL:
category_id:
5
version_id:
0
issue_org_id:
8992
author_id:
6870
assigned_to_id:
1
comments:
0
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
35
説明
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:
h2. 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) %>
h2. 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 @message in file app/views/messages/edit.rhtml (line 7):
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board, :id => @message },
いいね!0