Bug 16158

Summary: GetAuthorisedValues should not be called inside a loop
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brendan, mtompset
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 16157    
Bug Blocks:    
Attachments: Bug 16158: Move GetAuthorisedValues outside the loop
Bug 16158: Move GetAuthorisedValues outside the loop
Bug 16158: Move GetAuthorisedValues outside the loop

Description Jonathan Druart 2016-03-29 16:07:22 UTC
There are no needs to call this subroutine inside a loop (bug 16157 has removed the selected flag).
Comment 1 Jonathan Druart 2016-03-29 16:14:01 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2016-04-06 00:50:03 UTC
(In reply to Jonathan Druart from comment #0)
> There are no needs to call this subroutine inside a loop (bug 16157 has
> removed the selected flag).

Agreed. The Authorized Value Name for the item fields isn't going to change, since the Biblio is the same which keeps the framework code the same.
Comment 3 Mark Tompsett 2016-04-06 01:11:44 UTC
Please rebase.
Comment 4 Jonathan Druart 2016-04-06 10:22:50 UTC
(In reply to M. Tompsett from comment #3)
> Please rebase.

Apply cleanly on top of bug 16157.
Comment 5 Mark Tompsett 2016-04-06 10:53:53 UTC
(In reply to Jonathan Druart from comment #4)
> (In reply to M. Tompsett from comment #3)
> > Please rebase.
> 
> Apply cleanly on top of bug 16157.

DOH! Sorry, I missed that. It does.
Comment 6 Mark Tompsett 2016-04-06 12:30:07 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2016-04-08 07:28:22 UTC
Created attachment 50048 [details] [review]
Bug 16158: Move GetAuthorisedValues outside the loop

In catalogue/detail.pl and catalogue/moredetail.pl, the
GetAuthorisedValues subroutine is called once per item. It's not needed,
only 1 call is enough.

Test plan:
Edit item and view a catalogue record.
The withdrawn, lost and damaged values should be correctly
displayed/saved.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Brendan Gallagher 2016-04-27 16:30:39 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks!