]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 434062: Attachment flags can only be set once per bug (regression) - Patch by...
authorlpsolit%gmail.com <>
Sat, 17 May 2008 18:59:07 +0000 (18:59 +0000)
committerlpsolit%gmail.com <>
Sat, 17 May 2008 18:59:07 +0000 (18:59 +0000)
Bugzilla/Flag.pm

index a65a8268b1f5404ce11ef339e2378fac029da15b..6266b0c0cc1d8957de3f92c425aeb069f71ca61c 100644 (file)
@@ -228,12 +228,12 @@ sub match {
     # If the caller specified only bug or attachment flags,
     # limit the query to those kinds of flags.
     if (my $type = delete $criteria->{'target_type'}) {
-        if ($type eq 'attachment') {
-            $criteria->{'attach_id'} = NOT_NULL;
-        }
-        else {
+        if ($type eq 'bug') {
             $criteria->{'attach_id'} = IS_NULL;
         }
+        elsif (!defined $criteria->{'attach_id'}) {
+            $criteria->{'attach_id'} = NOT_NULL;
+        }
     }
     # Flag->snapshot() calls Flag->match() with bug_id and attach_id
     # as hash keys, even if attach_id is undefined.