From: Dave Miller Date: Tue, 4 Aug 2026 00:04:30 +0000 (-0400) Subject: Bug 889650: Fix crash when searching "match all of the same field" on Flags (#237) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;ds=sidebyside;p=thirdparty%2Fbugzilla.git Bug 889650: Fix crash when searching "match all of the same field" on Flags (#237) r=mrenvoize --- diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 53ece5113..8cddf76bb 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -2900,7 +2900,7 @@ sub _flagtypes_nonchanged { # don't call build_subselect as this must run as a true sub-select $args->{term} = "EXISTS ( SELECT 1 - FROM $bugs_table bugs_$chart_id + FROM bugs bugs_$chart_id LEFT JOIN attachments AS attachments_$chart_id ON bugs_$chart_id.bug_id = attachments_$chart_id.bug_id LEFT JOIN flags AS flags_$chart_id diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm index fe5b0a7b7..7760ba432 100644 --- a/xt/lib/Bugzilla/Test/Search/Constants.pm +++ b/xt/lib/Bugzilla/Test/Search/Constants.pm @@ -1244,6 +1244,16 @@ use constant CUSTOM_SEARCH_TESTS => ( ] }, + { + name => 'flagtypes.name = <1> AND flagtypes.name = <1>', + contains => [1], + top_params => {j_top => 'AND_G'}, + params => [ + {f => 'flagtypes.name', o => 'equals', v => '<1>'}, + {f => 'flagtypes.name', o => 'equals', v => '<1>'}, + ] + }, + ); 1;