From 4b139ba1954b5c1451f842996ae42511c9369c05 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 4 Oct 2018 14:08:32 -0300 Subject: [PATCH] Bug 21500: Remove warnings in rotating collections To test: - Go to Tools > Rotating collections => FAIL: Some warinings on the logs - Apply this patch - Reload page => SUCCESS: No warinings - Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit 40803d30359f347417999429b612fcece9fc96f9) Signed-off-by: Martin Renvoize --- rotating_collections/addItems.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rotating_collections/addItems.pl b/rotating_collections/addItems.pl index cd24d50fd7..74b3e16844 100755 --- a/rotating_collections/addItems.pl +++ b/rotating_collections/addItems.pl @@ -39,7 +39,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -if ( $query->param('action') eq 'addItem' ) { +if ( defined $query->param('action') and + $query->param('action') eq 'addItem' ) { ## Add the given item to the collection my $colId = $query->param('colId'); my $barcode = $query->param('barcode'); @@ -88,7 +89,7 @@ if ( $query->param('action') eq 'addItem' ) { } my ( $colId, $colTitle, $colDescription, $colBranchcode ) = - GetCollection( $query->param('colId') ); + GetCollection( scalar $query->param('colId') ); my $collectionItems = GetItemsInCollection($colId); if ($collectionItems) { $template->param( collectionItemsLoop => $collectionItems ); -- 2.39.5