abahgat / redmine_didyoumean

A Redmine plugin to search for possible duplicates when users are about to open new issues.
Other
68 stars 45 forks source link

Error while creating new issue #43

Open pasitive opened 11 years ago

pasitive commented 11 years ago

Steps that causes the error:

  1. Install plugin
  2. Restart redmine
  3. Trying to create new issue ->3. Error trying to create new issue

Expected result: No error while creating new issue


Environment: Redmine version 2.2.3.stable Ruby version 1.9.3 (i686-linux) Rails version 3.2.12 Environment production Database adapter Mysql2 Redmine plugins: advanced_roadmap 0.8.0 redmine_contacts 3.1.2-light redmine_contacts_helpdesk 2.1.3 redmine_issue_checklist 2.0.5 redmine_issue_templates 0.0.5 redmine_monitoring_controlling 0.1.1 redmine_people 0.1.6 redmine_questions 0.0.4 redmine_timesheet_plugin 0.7.0

Installed plugins are

Advanced roadmap & milestones plugin 0.8.0 Redmine CRM plugin 3.1.2-light Redmine Helpdesk plugin 2.1.3 Redmine Issue Checklist plugin 2.0.5 Redmine Issue Templates plugin 0.0.5
Redmine (Monitoring & Controlling | Monitoramento & Controle) 0.1.1 Redmine People plugin 0.1.6 Redmine Q&A plugin 0.0.4 Redmine Timesheet Plugin 0.7.0

Trace from production.log

Started GET "/projects/sys/issues/new" for 127.0.0.1 at 2013-03-12 15:40:50 +0400 Processing by IssuesController#new as HTML Parameters: {"project_id"=>"sys"} Current user: dboldinov (id=1) Rendered plugins/redmine_contacts_helpdesk/app/views/issues/_ticket_data_form.html.erb (1.2ms) Rendered plugins/redmine_issue_templates/app/views/issue_templates/_issue_select_form.html.erb (1.1ms) Rendered issues/_form_custom_fields.html.erb (4.5ms) Rendered issues/_attributes.html.erb (27.0ms) Rendered plugins/redmine_issue_checklist/app/views/issues/_checklist_form.html.erb (2.1ms) DEPRECATION WARNING: Passing a template handler in the template name is deprecated. You can simply remove the handler name or pass render :handlers => [:erb] instead. (called from block in render_on at /srv/app/redmine/lib/redmine/hook.rb:111) Rendered plugins/redmine_didyoumean/app/views/issues/_didyoumean_injected.html.erb (147.8ms) Rendered issues/_form.html.erb (194.5ms) Rendered issues/new.html.erb within layouts/base (195.2ms) Completed 500 Internal Server Error in 247ms

ActionView::Template::Error (undefined local variable or method issues_didyoumean_event_type' for #<#<Class:0xc71e3e4>:0xc7a3544>): 19: }; 20: </script> 21: 22: <%= javascript_tag "observeIssueSubjectField('#{@project.id}', #{@issue.id or '\'\''}, '#{issues_didyoumean_event_type}');" %> lib/redmine/hook.rb:111:inblock in render_on' lib/redmine/hook.rb:61:in block (2 levels) in call_hook' lib/redmine/hook.rb:61:ineach' lib/redmine/hook.rb:61:in block in call_hook' lib/redmine/hook.rb:58:intap' lib/redmine/hook.rb:58:in call_hook' lib/redmine/hook.rb:158:incall_hook' app/views/issues/_form.html.erb:44:in block in _app_views_issues__form_html_erb__902340551_104669920' app/helpers/application_helper.rb:998:inlabelled_fields_for' app/views/issues/_form.html.erb:1:in _app_views_issues__form_html_erb__902340551_104669920' app/views/issues/new.html.erb:11:inblock in _app_views_issues_new_html_erb1016058985_104438100' app/helpers/application_helper.rb:991:in labelled_form_for' app/views/issues/new.html.erb:5:in_app_views_issues_new_html_erb1016058985_104438100' app/controllers/issues_controller.rb:134:in block (2 levels) in new' app/controllers/issues_controller.rb:133:innew'

akohlsmith commented 11 years ago

I too am receiving this error when running from master. tag v1.2.0 works fine, but I was hoping to use the "start search while typing the issue subject" setting.

rlisowski commented 10 years ago

Try my suggestion from #54 : move IssuesHelper.send :include, RedmineDidyoumean::Patches::SearchIssuesHelperPatch outside ActionDispatch::Callbacks.to_prepare block in init.rb Works for me in Redmine 2.5.2.stable

abahgat commented 10 years ago

Thanks guys, sorry for the long wait. d3331707241d82b130d597276b2d8387adc0a424 by @namezero111111 should fix this: would you mind pulling it and seeing if that works for you?