Bug 11056

Summary: dead code in basketgroup.pl : remove code depending on "validate" param
Product: Koha Reporter: Mathieu Saby <mathsabypro>
Component: AcquisitionsAssignee: Mathieu Saby <mathsabypro>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: gmcharlt
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: [PATCH] Bug 11056 : Delete dead code in basketgroup.pl
[PATCH] Bug 11056 : Delete dead code in basketgroup.pl
Bug 11056 : Delete dead code in basketgroup.pl
Bug 11056 : Delete dead code in basketgroup.pl

Description Mathieu Saby 2013-10-15 21:53:43 UTC
Some code is dead in basketgroup.pl
all the block depending on 
"($op eq 'validate')" clause

the "validate" parameter is no more used in template, since a Biblibre commit has rewritten basketgroup template in 2009 : 
http://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=263961312c1ff7605ed1e28df40191ab01a75af9

M. Saby
Comment 1 Mathieu Saby 2013-12-18 17:15:30 UTC Comment hidden (obsolete)
Comment 2 Mathieu Saby 2013-12-18 17:15:47 UTC
In basketgroup.pl, some code is supposed to be executed if $op = "validate".
But this value is no more assigned to $op variable since 2009.

This patch suppressed dead code.
No functional changes expected

Regression test : check basketgroup are shown as before the patch, and can be closed and reopen.
Check you can create a basketgroup when you close a basket.


M. Saby
Comment 3 Mathieu Saby 2013-12-20 22:06:09 UTC
Functions parseinputbaskets and parseinputbasketgroups are only called by this dead code. So they could be removed too.

M. Saby
Comment 4 Mathieu Saby 2013-12-20 22:44:48 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2014-01-17 16:18:53 UTC Comment hidden (obsolete)
Comment 6 Mathieu Saby 2014-01-17 16:33:57 UTC
Oh, I did not even know "git grep" command!
Mathieu
Comment 7 Kyle M Hall (khall) 2014-01-17 17:22:56 UTC
Created attachment 24526 [details] [review]
Bug 11056 : Delete dead code in basketgroup.pl

In basketgroup.pl, some code is supposed to be executed if $op = "validate".
But this value is no more assigned to $op variable since 2009.

This patch suppressed dead code, along with parseinputbaskets and parseinputbasketgroups subs, which are obsolete.
No functional changes expected

Regression test :
Check basketgroup are shown as before the patch, and can be closed and reopen.
Check you can add or remove a basket from a basketgroup, and change informations about it (like delivery place)
Check you can create a basketgroup when you close a basket.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The following commands return nothing:
- grep validate acqui/basketgroup.tt
- grep -R basketgroup.pl -C 2 | grep validate
- git grep parseinputbaskets
- git grep parseinputbasketgroups
- git grep basketgroup.pl | grep validate

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Galen Charlton 2014-01-17 21:20:45 UTC
Pushed to master.  Thanks, Mathieu!