]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 511796: Allow groups to bless themselves
authormkanat%bugzilla.org <>
Wed, 30 Sep 2009 08:59:50 +0000 (08:59 +0000)
committermkanat%bugzilla.org <>
Wed, 30 Sep 2009 08:59:50 +0000 (08:59 +0000)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

editgroups.cgi

index 0554638faf934235735df991a8167c9f4d4621e9..e8d8cfe24e6ae7a83ba39296eff552522f3ad840 100755 (executable)
@@ -113,16 +113,19 @@ sub get_current_and_available {
                 if !grep($_->id == $group_option->id, @visible_to_me_current);
         }
 
-        # The group itself should never show up in the bless or 
-        # membership lists.
+        push(@bless_from_available, $group_option)
+            if !grep($_->id == $group_option->id, @bless_from_current);
+
+        # The group itself should never show up in the membership lists,
+        # and should show up in only one of the bless lists (otherwise
+        # you can try to allow it to bless itself twice, leading to a
+        # database unique constraint error).
         next if $group_option->id == $group->id;
 
         push(@members_available, $group_option)
             if !grep($_->id == $group_option->id, @members_current);
         push(@member_of_available, $group_option)
             if !grep($_->id == $group_option->id, @member_of_current);
-        push(@bless_from_available, $group_option)
-            if !grep($_->id == $group_option->id, @bless_from_current);
         push(@bless_to_available, $group_option)
            if !grep($_->id == $group_option->id, @bless_to_current);
     }