Commit cd3cfa86 authored by Kevin Falcone's avatar Kevin Falcone
Browse files

Reduce our extra Query Args when pulling from the session.

As discovered by sunnavy when he went spelunking to determine why
t/walk-web.t started running so many extra tests (7a630ac1), we were
stuffing a bunch of extra query params into the query string,
depending on whether we did that from the hash or passed args (things
like Object and Description).

I rewrote his patch a bit to use the same Field list as search_arguments

We lose saved search state badly in RTIR, but it's not a regression
caused by this code, see [rtir #25241]
parent 2b195018
......@@ -56,10 +56,11 @@ my $query_string = sub {
my $args = $DECODED_ARGS;
my @query_fields = qw(Query Format RowsPerPage Page OrderBy Order);
my $search_arguments = sub {
my %res = ();
my $caller_args = $m->caller_args(1);
my @query_fields = qw(Query Format RowsPerPage Page OrderBy Order);
if ( $caller_args->{'SearchArgs'} ) {
@res{ @query_fields } = @{ $caller_args->{'SearchArgs'} }{ @query_fields };
} else {
......@@ -75,7 +76,7 @@ my $search = $root->child( search => title => loc('Search'), path => '/RTIR/Sear
$search->child( new => title => loc('New Search'), path => '/RTIR/Search/?NewQuery=1' );
{
my $current_search = $session{"CurrentSearchHash"} || {};
my $current_search = $session{'CurrentSearchHash'} ? { map { $_ => $session{'CurrentSearchHash'}{$_} } @query_fields } : {};
my $has_query = 1 if ( $args->{'Query'} or $current_search->{'Query'} );
if ( $has_query ) {
......
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