ndl / wiki_external_filter

Redmine plugin which allows defining macros that process macro argument using external filter program and render its result in wiki.
http://www.ndl.kiev.ua/content/redmine-wiki-external-filter-plugin
Other
36 stars 35 forks source link

Video embedding failed #7

Closed siamak-haschemi closed 1 year ago

siamak-haschemi commented 13 years ago

I Installed ffmeg, librmagick, and wget through apt-get. I pulled the last git revision.

I attached a video (http://www.cna.org/isaac/einstein_fluid.avi) to a wiki site, and added {{video(einstein_fluid.avi)}} . I got following error:

Error executing the video macro ( ActionView::TemplateError (undefined method +' for nil:NilClass) on line #5 of vendor/plugins/wiki_external_filter/app/views/wiki_external_filter/macro_flash-video.html.erb: 2: require 'RMagick' 3: image = Magick::Image::from_blob(content[0]).first 4: %> 5: ' href='<%= ActionController::Base.relative_url_root + "/wiki_external_filter/#{macro}.flv?name=#{name}" %>' title='<%= h source %>' style='display:block;width:<%= image.columns %>px;height:<%= image.rows + 24 %>px;background-image:url(<%= url_for(:controller => 'wiki_external_filter', :action => 'filter', :macro => macro, :name => name, :index => 0) %>);background-repeat:no-repeat'><%= image_tag 'play_large.png', :plugin => 'wiki_external_filter', :style => "display:block;position:relative;left:#{image.columns / 2 - 83 / 2}px;top:#{image.rows / 2 - 83 / 2}px" %> 6: <% 7: content_for :header_tags do 8: if not @flowplayer_scripts_included vendor/plugins/wiki_external_filter/app/views/wiki_external_filter/macro_flash-video.html.erb:5 vendor/plugins/wiki_external_filter/app/helpers/wiki_external_filter_helper.rb:151:inrender_common' vendor/plugins/wiki_external_filter/app/helpers/wiki_external_filter_helper.rb:135:in render_tag' vendor/plugins/wiki_external_filter/app/helpers/wiki_external_filter_helper.rb:166:inrender' vendor/plugins/wiki_external_filter/init.rb:23:in macro_video' lib/redmine/wiki_formatting/macros.rb:24:insend' lib/redmine/wiki_formatting/macros.rb:24:in exec_macro' app/helpers/application_helper.rb:456 lib/redmine/wiki_formatting.rb:124:incall' lib/redmine/wiki_formatting.rb:124:in execute_macros' lib/redmine/wiki_formatting.rb:116:ingsub!' lib/redmine/wiki_formatting.rb:116:in execute_macros' lib/redmine/wiki_formatting.rb:62:into_html' app/helpers/application_helper.rb:456:in textilizable' app/views/wiki/_content.rhtml:2:in_run_rhtml_app47views47wiki47_content46rhtml_locals_content_object' app/views/wiki/show.rhtml:30:in _run_rhtml_app47views47wiki47show46rhtml' app/controllers/wiki_controller.rb:61:inindex' )

Thanks in advance!

Cheers, Siamak

ndl commented 13 years ago

The usage of the ActionController::Base.relative_url_root on the 5th line is very likely to be an error - I just didn't know what was the best way to generate non-standard URL that was required to reference the video and it's quite possible this code just does not work if relative_url_root is not set.

As a quick fix you can try to remove ActionController::Base.relative_url_root + altogether and leave only right part of the expression - that should work if your Redmine installation is not in the subfolder.

Unfortunately right now I do not have enough time to implement / test the proper solution, therefore I will leave this issue open and will try to come back to it once I perform one more round of changes in the plugin ...