Defect #33935
closed
  
Locked users in a group receive notifications when the group is added as a watcher
 
        
        Added by Yuichi HARADA about 5 years ago.
        Updated about 5 years ago.
        
Category:
Email notifications
 
  
  
  
  Description
  
  Reproduce by the following step.
	
	- Add the user-A to the group and then lock the user-A.
- Add the group to the issue's watcher.
- A notification is sent to locked user-A when the issue is updated.
 
 
  
  Files
  
 
  
  
    
    
    
    
    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?)
 
   
  
  
    
    
    
    
       - 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
 
   
  
  
    
    
    
    
       - Related to Feature #4511: Allow adding user groups as watchers for issues added
 
   
  
  
    
    
    
    
       - 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