Commit 7f997dd6 authored by sunnavy's avatar sunnavy
Browse files

in case $Query already includes $BaseQuery

here is the old code:

$BaseQuery ||= RT::IR->Query( Queue => $Queue );
$Query     ||= RT::IR->ActiveQuery( Queue => $Queue );

if both $BaseQuery and $Query are empty before, they will be set to
RT::IR->Query(...) and RT::IR->ActiveQuery(...) here, respectively.

but ->ActiveQuery already includes ->Query, so the finaly query will be for
example(combined by BaseQuery AND Query):

( ( Queue = 'Incidents' ) ) AND ( ( Queue = 'Incidents' ) AND Status = 'open' )

so we don't need to set $BaseQuery in this case.

you can reproduce it by accessing "/RTIR/Search/Results.html?Queue=Incidents"
and then clicking the "Edit Search" menu
parent a5acd00b
......@@ -82,8 +82,12 @@ RT::IR::Config::CheckObsoleteCFSyntax($Format,$location);
RT::IR::Config::CheckObsoleteCFSyntax($Query,$location);
if ( $Type ) {
$BaseQuery ||= RT::IR->Query( Queue => $Queue );
$Query ||= RT::IR->ActiveQuery( Queue => $Queue );
if ( $Query ) {
$BaseQuery ||= RT::IR->Query( Queue => $Queue );
}
else {
$Query = RT::IR->ActiveQuery( Queue => $Queue );
}
}
my $BaseURL = "RTIR/Search/Results.html";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment