Defect #33935

Locked users in a group receive notifications when the group is added as a watcher

Added by Yuichi HARADA about 1 year ago. Updated about 1 year ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Email notifications
Target version:-
Resolution:Fixed Affected version:

Description

Reproduce by the following step.

  1. Add the user-A to the group and then lock the user-A.
  2. Add the group to the issue's watcher.
  3. A notification is sent to locked user-A when the issue is updated.

fixed-33935.patch Magnifier (2.04 KB) Yuichi HARADA, 2020-09-01 02:51


Related issues

Related to Redmine - Feature #4511: Allow adding user groups as watchers for issues Closed 2010-01-01

Associated revisions

Revision 19998
Added by Go MAEDA about 1 year ago

Locked users in a group receive notifications when the group is added as a watcher (#4511, #33935).

Patch by Yuichi HARADA.

History

#1 Updated by Yuichi HARADA about 1 year ago

The following patch solved the issue.

diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 6b16e18a5..bb71a2884 100644
--- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -73,7 +73,7 @@ module Redmine

         def notified_watchers
           notified = watcher_users.active.to_a
-          notified = notified.map {|n| n.is_a?(Group) ? n.users : n}.flatten
+          notified = notified.map {|n| n.is_a?(Group) ? n.users.active : n}.flatten
           notified.uniq!
           notified.reject! {|user| user.mail.blank? || user.mail_notification == 'none'}
           if respond_to?(:visible?)

#2 Updated by Go MAEDA about 1 year ago

  • Subject changed from Send notifications to the locked users of group members to Locked users in a group get notification when the group is added as a watcher
  • Status changed from New to Confirmed

#3 Updated by Go MAEDA about 1 year ago

  • Related to Feature #4511: Allow adding user groups as watchers for issues added

#4 Updated by Go MAEDA about 1 year ago

  • Subject changed from Locked users in a group get notification when the group is added as a watcher to Locked users in a group receive notifications when the group is added as a watcher
  • Status changed from Confirmed to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r19998 as a part of #4511. Thank you.

Also available in: Atom PDF