2017-12-26 20 views
0

Redmineの中に私の構成では、私は、プラグインをインストールし、500内部サーバーエラー NoMethodError(nilのための未定義のメソッド `+」クラッシュエラープラグインがクラッシュ

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 

プラグイン取得しています:NilClassを):

プラグイン/ redmine_print_issue/libに/ redmine_print_issue /パッチ/ issues_controller_pa tch.rb:24:show_with_print' lib/redmine/sudo_mode.rb:63:in sudo_modeで」

に私は

答えて

0

プラグインが正しく)テンプレート名が欠落している(設定でデフォルト値をインスタンス化しないplzは私を助けて(

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 

ルビーを知らいけないんです。 チェックボックス(トラッカーの[印刷]ボタンを有効にする)をオンにしても、テンプレート名が格納されず、エラーが発生します。

これを回避する簡単な方法:ボタンのテキストを変更して(後で元に戻すことができます)、「適用」を押します。テンプレート名の保存がトリガーされます。

例テンプレートは例のテンプレートと同じです:例:

関連する問題