]> git.koha-community.org Git - koha.git/commit
Bug 10789: Remove unnecessary calls to $sth->finish in C4::Acquisitions
authorColin Campbell <colin.campbell@ptfs-europe.com>
Sun, 8 Dec 2013 22:26:18 +0000 (22:26 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 18 Feb 2014 21:44:51 +0000 (21:44 +0000)
commit2fac9a76450835337b015956a6f3150586aa5a17
treef46ae3dd883ea724327eefcede4484ab759a78bb
parentd3c565f12c5c9136588a17e6497d860f6c5e95ed
Bug 10789: Remove unnecessary calls to $sth->finish in C4::Acquisitions

C4::Acquisitions contained a number of unnecessary calls to
$sth->finish. Removed these and the associated variables introduced to
cache query results between fetch and the return

Where finish was the end of the routine I have added an
explicit return to document that no data is returned.

A number of places made query calls and fetched a single
row. Such a case could require an explicit finish.
These assume that they are looking up with a unique key.
To remove assumptions and isolate the code from future changes
I've switched these to fetching all and returning the
first row. I have commented these cases.

For fuller explanation see perldoc DBI

What I tested:
Edit existing basket, chnged name
Modify order line, change vendor price
Create new basket and add order
Delet this order
Delte this basket
New Basket, new order, user added, user removed
Add contract to vendor, change details, delete contract
Search order biblio
Create basket group, add basket to group, remove basket from group
Delete basket group
Receive order

Everything behaved as I expected

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Acquisition.pm