From 37a0ba4f1079e9874684b01dad12203519e8cfe3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 13 May 2016 20:46:42 +0100 Subject: [PATCH] Bug 16518: Fix Plack variable scoping problem in opac-addbybiblionumber.pl MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The script opac/opac-addbybiblionumber.pl is not plack safe because the variable @biblios is declared with our and is not assigned to an empty array (so not reset). The issue: When trying to add items to a list (virtualshelf), the biblionumbers are added to the @biblios variable and the list is not reset between each run. Test plan: Check from records from the result list and add them to a list. Cancel or save and re-add them (or others) to a list (same or different). => Without this patch, the list of records will never stop growing, the previous items added are still listed when adding new ones. => With this patch, the behavior is the one expected. Signed-off-by: Srdjan Signed-off-by: Marcel de Rooy Signed-off-by: Brendan Gallagher (cherry picked from commit ab1beed06f249d1e7d0be5bb1b584e62f5b48783) Signed-off-by: Frédéric Demians (cherry picked from commit 2729f038c34b5c4f0b713738c9bf4a94068f1b43) Signed-off-by: Julian Maurice --- opac/opac-addbybiblionumber.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index eec38bd832..a5decf7239 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -38,7 +38,7 @@ our $newvirtualshelf = $query->param('newvirtualshelf'); our $category = $query->param('category'); our $authorized = 1; our $errcode = 0; -our @biblios; +our @biblios = (); # if virtualshelves is disabled, leave immediately if ( ! C4::Context->preference('virtualshelves') ) { -- 2.39.5