redmine-git-hosting/redmine_git_hosting

Can't use group as watcher functionality

Alwaysin opened this issue · 1 comments

Since 4.2.0 we can use groups as watchers : https://www.redmine.org/issues/4511

But the plugin is looking for an email adress so viewing an issue that has a group as watchers fails with:

Started GET "/issues/5073" for 1.1.1.1 at 2021-06-23 18:07:47 +0200
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"5073"}
  Current user: blabla (id=65)
  Rendering issues/show.html.erb within layouts/base
  Rendered issues/_action_menu.html.erb (5.0ms)
  Rendered plugins/redmine_agile/app/views/issues/_issue_story_points.html.erb (1.2ms)
  Rendered plugins/redmine_checklists/app/views/issues/_checklist.html.erb (1.3ms)
  Rendered issue_relations/_form.html.erb (1.2ms)
  Rendered issues/_relations.html.erb (2.0ms)
  Rendered issues/_action_menu.html.erb (2.4ms)
  Rendered issues/_trackers_description.html.erb (0.6ms)
  Rendered issues/_form_custom_fields.html.erb (10.9ms)
  Rendered issues/_attributes.html.erb (27.2ms)
  Rendered plugins/redmine_agile/app/views/issues/_issue_story_points_form.html.erb (0.2ms)
  Rendered plugins/redmine_agile/app/views/issues/_agile_data_fields.html.erb (0.7ms)
  Rendered plugins/additionals/app/views/issues/_change_author.html.slim (2.6ms)
  Rendered plugins/redmine_checklists/app/views/issues/_checklist_fields.html.erb (1.0ms)
  Rendered plugins/redmine_checklists/app/views/issues/_checklist_fields.html.erb (14.7ms)
  Rendered plugins/redmine_checklists/app/views/issues/_checklist_form.html.erb (18.3ms)
  Rendered issues/_form.html.erb (89.9ms)
  Rendered attachments/_form.html.erb (2.0ms)
  Rendered issues/_edit.html.erb (101.7ms)
  Rendered issues/_action_menu_edit.html.erb (104.9ms)
  Rendered plugins/redmine_agile/app/views/agile_boards/_issues_sidebar.html.erb (0.4ms)
  Rendered plugins/redmine_agile/app/views/agile_charts/_agile_charts.html.erb (0.2ms)
  Rendered plugins/additionals/app/views/issues/_additionals_sidebar_issues.html.slim (0.1ms)
  Rendered plugins/additionals/app/views/issues/_additionals_sidebar_queries.html.slim (0.1ms)
  Rendered issues/_sidebar.html.erb (4.9ms)
  Rendered watchers/_watchers.html.erb (5.4ms)
  Rendered issues/show.html.erb within layouts/base (151.2ms)
Completed 500 Internal Server Error in 200ms (ActiveRecord: 41.6ms)

ActionView::Template::Error (Association named 'email_address' was not found on Group; perhaps you misspelled it?):
    10:
    11: <h3><%= l(:"label_#{watched_klass_name}_watchers") %> (<%= watched.watcher_users.size %>)</h3>
    12:
    13: <%= watchers_list(watched) %>

plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/watchers_helper_patch.rb:25:in `watchers_list_with_git_hosting'
app/views/watchers/_watchers.html.erb:13:in `_df2dd51a5d932fa5ed11309123cf76e6'
app/views/issues/show.html.erb:151:in `block in _0fab06748a71b800b95419a47486247b'
app/views/issues/show.html.erb:145:in `_0fab06748a71b800b95419a47486247b'
app/controllers/issues_controller.rb:112:in `block (2 levels) in show'
app/controllers/issues_controller.rb:104:in `show'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'

I am experiencing the same issue. Is there a quick fix to allow the ticket to be viewed again?

Ignore the quick fix question -- I updated the "watchers" table where a user_id was == a group.