From: lpsolit%gmail.com <> Date: Tue, 5 Feb 2008 05:24:20 +0000 (+0000) Subject: Bug 415663: Flag->snapshot() calls Flag->match() with attach_id being undefined when... X-Git-Tag: bugzilla-3.1.3~337 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b3d9fb410b0468259ecfd0e5f9852f1c0c5b225;p=thirdparty%2Fbugzilla.git Bug 415663: Flag->snapshot() calls Flag->match() with attach_id being undefined when editing bug flags - Patch by Frédéric Buclin a=LpSolit --- diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 1fc2a6827f..00e40e33f9 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -215,6 +215,11 @@ sub match { $criteria->{'attach_id'} = IS_NULL; } } + # Flag->snapshot() calls Flag->match() with bug_id and attach_id + # as hash keys, even if attach_id is undefined. + if (exists $criteria->{'attach_id'} && !defined $criteria->{'attach_id'}) { + $criteria->{'attach_id'} = IS_NULL; + } return $class->SUPER::match(@_); }