【发布时间】:2017-12-26 08:54:29
【问题描述】:
我在 redmine 中的配置,我正在安装插件并收到错误
Environment:
Redmine version 3.3.5.stable
Ruby version 2.3.4-p301 (2017-03-30) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.10
Git 2.1.4
redmine_print_issue 2.0.4
插件崩溃 500 内部服务器错误 NoMethodError(nil:NilClass 的未定义方法 `+'):
插件/redmine_print_issue/lib/redmine_print_issue/patches/ 问题_控制器_pa tch.rb:24:in
show_with_print' lib/redmine/sudo_mode.rb:63:insudo_mode' 在
我不认识鲁比(
module RedminePrintIssue
module Patches
module IssuesControllerPatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
Mime::Type.register "application/vnd.oasis.opendocument.text",
:odt, [], %w(odt)
alias_method_chain :show, :print
end
end
module InstanceMethods
def show_with_print
if request.formats.include? :odt then
ofile = Tempfile.new('print_template')
begin
qrcode = RQRCode::QRCode.new(url_for @order)
imgfile = Tempfile.new('print_template_image')
imgfile.write qrcode.as_svg
@issue.class_eval('def images=(images); @images=images; end')
@issue.images = { "qrcode" => imgfile.path }
@issue.render_odt
@issue.odt_path(Setting.plugin_redmine_print_issue["tracker_#
{@issue.tracker_id.to_s}_template"]+'.odt'), ofile.path
respond_to do |format|
format.odt { send_file ofile.path, type: "application/vnd.oasis.opendocument.text", filename: "##{@issue.id} #{@issue.subject}.odt" }
end
ensure
ofile.close
imgfile.close
end
else
show_without_print
end
end
end
end
end
end
unless IssuesController.included_modules.include?(RedminePrintIssue::Patches::IssuesControllerPatch)
IssuesController.send(:include, RedminePrintIssue::Patches::IssuesControllerPatch)
end
请帮帮我
【问题讨论】: