Open rg-ac opened 6 years ago
Here is a diff which fixed it for me
--- a/lib/latex_wiki_page.rb
+++ b/lib/latex_wiki_page.rb
@@ -7,8 +7,10 @@ module ModuleLatexWikiPage
# Collect all attached images and get disk filename
file_sub = {}
self.wiki_page.attachments.each do |att|
- unless att.content_type.match(/^image/i).nil?
- file_sub[att.filename] = att.diskfile
+ if att.content_type
+ unless att.content_type.match(/^image/i).nil?
+ file_sub[att.filename] = att.diskfile
+ end
end
end
btw. how to paste Diff in markdown?
On some pages I have an 'Internal Error' and in the logfile I see:
NoMethodError (undefined method
match' for nil:NilClass): plugins/redmine_doc_pu/lib/latex_wiki_page.rb:10:in
block in to_latex' plugins/redmine_doc_pu/lib/latex_wiki_page.rb:9:into_latex' plugins/redmine_doc_pu/app/models/doc_pu_wiki_page.rb:24:in
to_latex' plugins/redmine_doc_pu/lib/latex_doc.rb:67:inblock in to_latex' plugins/redmine_doc_pu/lib/latex_doc.rb:66:in
to_latex' plugins/redmine_doc_pu/lib/latex_doc.rb:120:inbuild' plugins/redmine_doc_pu/app/models/doc_pu_document.rb:27:in
build' plugins/redmine_doc_pu/app/controllers/doc_pu_controller.rb:101:inbuild_remote' lib/redmine/sudo_mode.rb:63:in
sudo_mode'Environment: Redmine version 3.2.8.stable Ruby version 2.2.9-p480 (2017-12-15) [x86_64-linux] Rails version 4.2.7.1 Environment production Database adapter Mysql2 SCM: Subversion 1.8.8 Git 1.9.1 Filesystem
Redmine plugins: redmine_backlogs v1.0.6 redmine_base_deface 0.0.1 redmine_doc_pu 2.1.0 redmine_maintenance_mode 2.1.0
Any Ideas?