alexbevi / redmine_knowledgebase

A knowledgebase plugin for Redmine
452 stars 199 forks source link

Error 500 when uploading PDF or image files #383

Closed tiurlumbangaol closed 1 year ago

tiurlumbangaol commented 3 years ago

Error 500 when uploading PDF or image files.

the production log saying : ActionView::Template::Error (undefined methodthumbnail_path'`

This issue only there when we upload PDF or images files.

the solution step 1 edit this file : plugins/redmine_knowledgebase/app/helpers/knowledgebase_helper.rb

change : return "#{Setting.protocol}://#{Setting.host_name}#{thumbnail_path(thumb)}"

to : return polymorphic_url(thumb, :host => Setting.host_name, :protocol => Setting.protocol)

solution step 2 : rename file from : app\views\attachments_links.html.erb to app\views\attachments_links.html.erb.bak or you could simply delete the file

and the error is gone. the solution is from : https://github.com/wiesion/redmine_knowledgebase

is it a proper fix?

alexbevi commented 1 year ago

Closed via #406