Project

General

Profile

Actions

Defect #33935

closed

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

Added by Yuichi HARADA over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Email notifications
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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.

Files

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

Related issues

Related to Redmine - Feature #4511: Allow adding user groups as watchers for issuesClosedGo MAEDA2010-01-01

Actions
Actions #1

Updated by Yuichi HARADA over 3 years 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?)
Actions #2

Updated by Go MAEDA over 3 years 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
Actions #3

Updated by Go MAEDA over 3 years ago

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

Updated by Go MAEDA over 3 years 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.

Actions

Also available in: Atom PDF