From 49d401691e50eeb98310060e06b4c040ba0c19cc 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 Signed-off-by: Fridolin Somers Signed-off-by: Julian Maurice --- tools/viewlog.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 9c2141eb2f..d17dc43435 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -53,7 +53,7 @@ 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 = $input->param("object") // ''; my $object_type = $input->param("object_type") // ''; my $info = $input->param("info"); my $datefrom = $input->param("from"); @@ -90,10 +90,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($object); +$template->param( subscriptionsnumber => $subscriptionsnumber ) if $subscriptionsnumber; + if ($do_it) { my $dtf = Koha::Database->new->schema->storage->datetime_parser; my %search_params; -- 2.20.1