Bug 16518

Summary: opac-addbybiblionumber is not plack safe
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: abl, brendan, f.demians, julian.maurice, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 7172, 16519    
Attachments: Bug 16518: Fix Plack variable scoping problem in opac-addbybiblionumber.pl
[SIGNED-OFF] Bug 16518: Fix Plack variable scoping problem in opac-addbybiblionumber.pl
Bug 16518: Fix Plack variable scoping problem in opac-addbybiblionumber.pl

Description Jonathan Druart 2016-05-13 19:46:40 UTC
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).
Comment 1 Jonathan Druart 2016-05-13 19:51:08 UTC Comment hidden (obsolete)
Comment 2 Srdjan Jankovic 2016-05-16 06:18:56 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2016-06-04 13:41:29 UTC
Created attachment 52055 [details] [review]
Bug 16518: Fix Plack variable scoping problem in opac-addbybiblionumber.pl

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 <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Brendan Gallagher 2016-06-06 17:31:26 UTC
Pushed to Master - Should be in the November 2016 Release.  Thanks
Comment 5 Frédéric Demians 2016-06-15 07:39:26 UTC
Pushed in 16.05. Will be in 16.05.01.
Comment 6 Julian Maurice 2016-06-16 08:27:45 UTC
Patch pushed to 3.22.x, will be in 3.22.8