From: lpsolit%gmail.com <> Date: Sat, 17 May 2008 18:59:07 +0000 (+0000) Subject: Bug 434062: Attachment flags can only be set once per bug (regression) - Patch by... X-Git-Tag: bugzilla-3.3~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a60171ca78b4b601b72274f2132816ea247ca55d;p=thirdparty%2Fbugzilla.git Bug 434062: Attachment flags can only be set once per bug (regression) - Patch by Frédéric Buclin a=LpSolit (module owner) --- diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index a65a8268b1..6266b0c0cc 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -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.