jrupesh / event_notifications

Redmine event notifications : Add event notification options to the each event at the redmine project. For EX: notifications can be enabled / disabled on each document added or news added. Further the tracking can be done at the issue tracker level.
BSD 3-Clause "New" or "Revised" License
28 stars 26 forks source link

500 internal error on 3.3.0 when going to My account page #32

Closed CorwinCZ closed 6 years ago

CorwinCZ commented 7 years ago

Hi,

I have similar problem like #12 with this plugin. When I enable "Enable Event notification plugin." option and then go to My account page, I got 500 error. Setting, version of redmine and log entry:

Redmine version redmine settings

Plugin settings plugin settings

Log output

Started GET "/my/account" for 82.142.96.203 at 2017-03-13 11:50:42 +0100
Processing by MyController#account as HTML
  Current user: canekpet (id=5)
  Rendered users/_preferences.html.erb (6.7ms)
  Rendered plugins/event_notifications/app/views/my/_general_settings.html.erb (13.1ms)
  Rendered plugins/event_notifications/app/views/users/_mail_notifications.html.erb (16.5ms)
  Rendered plugins/event_notifications/app/views/my/_notification_settings.html.erb (16.8ms)
  Rendered common/_tabs.html.erb (31.1ms)
  Rendered plugins/event_notifications/app/views/my/account.html.erb within layouts/base (37.3ms)
Completed 500 Internal Server Error in 48ms (ActiveRecord: 4.8ms)

ActionView::Template::Error (undefined method `events' for #<Member:0x00000004f4e2b0>):
    20:                   else { $( \".event_#{project.id}\" ).hide();$( \".event_#{project.id} input\" ).prop( \"checked\", false );
    21:                   $( \".event_#{project.id} select option\" ).prop( \"selected\", false ); }" }
    22: 
    23:           bool_val = @user.notified_events_projects_ids.include?(project.id)
    24: 
    25:           hidden_field_tag( 'user[notified_project_ids][]', "#{value}", :id => "hidden_#{project.id}" ) +
    26:           content_tag('label',
  plugins/event_notifications/lib/event_notification/patches/user_patch.rb:32:in `block in notified_events_projects_ids'
  plugins/event_notifications/lib/event_notification/patches/user_patch.rb:32:in `notified_events_projects_ids'
  plugins/event_notifications/app/views/users/_mail_notifications.html.erb:23:in `block (2 levels) in _plugins_event_notifications_app_views_users__mail_notifications_html_erb___2900193790063002793_105395600'
  app/helpers/application_helper.rb:283:in `block in render_project_nested_lists'
  app/helpers/application_helper.rb:268:in `each'
  app/helpers/application_helper.rb:268:in `render_project_nested_lists'
  plugins/event_notifications/app/views/users/_mail_notifications.html.erb:12:in `block in _plugins_event_notifications_app_views_users__mail_notifications_html_erb___2900193790063002793_105395600'
  plugins/event_notifications/app/views/users/_mail_notifications.html.erb:11:in `_plugins_event_notifications_app_views_users__mail_notifications_html_erb___2900193790063002793_105395600'
  plugins/event_notifications/app/views/my/_notification_settings.html.erb:5:in `_plugins_event_notifications_app_views_my__notification_settings_html_erb___2112214551513180492_105439440'
  app/views/common/_tabs.html.erb:17:in `block in _app_views_common__tabs_html_erb__577076020272278905_91737840'
  app/views/common/_tabs.html.erb:16:in `each'
  app/views/common/_tabs.html.erb:16:in `_app_views_common__tabs_html_erb__577076020272278905_91737840'
  app/helpers/application_helper.rb:325:in `render_tabs'
  plugins/event_notifications/app/views/my/account.html.erb:24:in `block in _plugins_event_notifications_app_views_my_account_html_erb__2362432998187246224_94466000'
  app/helpers/application_helper.rb:1051:in `labelled_form_for'
  plugins/event_notifications/app/views/my/account.html.erb:14:in `_plugins_event_notifications_app_views_my_account_html_erb__2362432998187246224_94466000'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Additional notes Rest of the plugin seems to work without issue - I can disable notification for specific custom fields - this works.

jrupesh commented 6 years ago

Hi, I think you have not executed the migration. This will solve the problem. Thanks,