anjlab / redmine_inline_note_images_plugin

Redmine plugin for inline note images display
12 stars 11 forks source link

500 Error saving update of issue (with or without attached image) #5

Closed caramella closed 11 years ago

caramella commented 11 years ago

redmine version 2.2.0 (ubuntu server 12 lts, ruby 1.8.7, mysql 5.1.66

Step create issue with image = 0k reopen that issue and add update = error clicking on SAVE

this is related (?) excerpt of log: Started GET "/issues/6" for 192.168.193.1 at Mon Jan 07 09:53:11 +0000 2013 Processing by IssuesController#show as HTML Parameters: {"id"=>"6"} Current user: admin (id=1) Rendered issues/_action_menu.html.erb (3.4ms) Rendered attachments/_links.html.erb (6.6ms) Rendered issue_relations/_form.html.erb (1.2ms) Rendered issues/_relations.html.erb (2.3ms) Rendered plugins/redmine_inline_note_images_plugin/app/views/hooks/inline_image_hook/_inline_imag es_paste.erb (125.7ms) Rendered issues/_history.html.erb (131.6ms) Rendered issues/show.html.erb within layouts/base (156.9ms) Completed 500 Internal Server Error in 203ms

ActionView::Template::Error (compile error /var/www/redmine/plugins/redmine_inline_note_images_plugin/app/views/hooks/inline_image_hook/_inlin e_images_paste.erb:2: syntax error, unexpected ':', expecting ')' '); journal.details.where(property: 'attachment').each do |a| ^ /var/www/redmine/plugins/redmine_inline_note_images_plugin/app/views/hooks/inline_image_hook/_inline_images_paste.erb:2: syntax error, unexpected ')', expecting kEND '); journal.details.where(property: 'attachment').each do |a| ^): 1:

2: <% journal.details.where(property: 'attachment').each do |a| %> 3: 4: <% attachment = Attachment.find_by_id a.prop_key %> 5: <% if attachment.present? && attachment.image? %> lib/redmine/hook.rb:111:in send' lib/redmine/hook.rb:111:inview_issues_history_journal_bottom' lib/redmine/hook.rb:61:in send' lib/redmine/hook.rb:61:incall_hook' lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:incall_hook' lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:incall_hook' lib/redmine/hook.rb:158:in call_hook' app/views/issues/_history.html.erb:19:in_app_views_issueshistory_html_erb613496489_111121650' app/views/issues/_history.html.erb:2:in each' app/views/issues/_history.html.erb:2:in_app_views_issueshistory_html_erb613496489_111121650' app/views/issues/show.html.erb:124:in _app_views_issues_show_html_erb__597076495_110065480' app/controllers/issues_controller.rb:119:inshow' app/controllers/issues_controller.rb:116:in `show'

regards

ghost commented 11 years ago

Can reproduce this

ghost commented 11 years ago

I wrote a possible patch: https://gist.github.com/4476690

Its because of the new syntax in 1.9 and usage of ruby 1.8

serggl commented 11 years ago

fixed. Thanks

deskbookers commented 11 years ago

tbh you did not apply the patch to repo, is that for a reason?