From 4e495b69ad23db7672ea4802e00407781eb35afc Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 4 Aug 2020 19:37:02 +0000 Subject: [PATCH] Bug 26137: Prevent warns form malformed params To test: 1 - Tail plack logs 2 - Browse to Tools->Log viewer 3 - Note an error 4 - Apply patch 5 - Confirm error is gone 6 - Confirm everytihg stil works right --- tools/viewlog.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 2ccd472f0e..a988157163 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -53,8 +53,8 @@ my @modules = $input->multi_param("modules"); my $user = $input->param("user") // ''; my @actions = $input->multi_param("actions"); my @interfaces = $input->multi_param("interfaces"); -my $object = $input->param("object"); -my $object_type = $input->param("object_type"); +my $object = $input->param("object") // ''; +my $object_type = $input->param("object_type") // ''; my $info = $input->param("info"); my $datefrom = $input->param("from"); my $dateto = $input->param("to"); @@ -91,10 +91,12 @@ if ( $src eq 'circ' ) { $template->param( debug => $debug, C4::Search::enabled_staff_search_views, - subscriptionsnumber => CountSubscriptionFromBiblionumber(scalar $input->param('object')), object => $object, ); +my $subscriptionsnumber = CountSubscriptionFromBiblionumber(scalar $input->param('object')); +$template->param( subscriptionsnumber => $subscriptionsnumber ) if $subscriptionsnumber; + if ($do_it) { my $dtf = Koha::Database->new->schema->storage->datetime_parser; my %search_params; -- 2.11.0