]> 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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 19 May 2014 14:26:19 +0000 (16:26 +0200)
commit3c6db9c780c01ef430117d5bf943826cd2b996f7
treef0762bff60be14fe6ce53c40971ae6a098407176
parentd3bdf5de9fc1265def455878963253af93694d2e
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>
(cherry picked from commit 2fac9a76450835337b015956a6f3150586aa5a17)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Acquisition.pm