Main Koha release repository
https://koha-community.org
d000a71635
In C4::Items::DelItemCheck, there are two SQL queries: one to check if item is on loan, the other if item is reserved. Those two queries use "SELECT * FROM table", fetch the data with "$var = $sth->fetchrow", and use "$var" as a boolean condition. This is not correct, SQL query should be "SELECT COUNT(*) FROM table". As a consequence, it was possible to delete an item without warning to the operator even if it was waiting on the hold shelf or in transit to fill a hold. This patch corrects the SQL queries and sets my ($var) to show that fetchrow returns an array. Test plan : - Set an item A onloan - Set an item B reserved and the reserve waiting - Go to items cataloguing : cgi-bin/koha/cataloguing/additem.pl?biblionumber=XXX - Try to delete item A => You get an alert and item is not deleted - Try to delete item B => You get an alert and item is not deleted Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Works, and has the added bonus of being a tiny bit faster. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes t, xt and QA script tests. Also tried deleting via batch delete - correct warnings are displayed. Signed-off-by: Galen Charlton <gmc@esilibrary.com> |
||
---|---|---|
acqui | ||
admin | ||
authorities | ||
basket | ||
C4 | ||
catalogue | ||
cataloguing | ||
circ | ||
course_reserves | ||
debian | ||
docs | ||
errors | ||
etc | ||
install_misc | ||
installer | ||
Koha | ||
koha-tmpl | ||
labels | ||
members | ||
misc | ||
offline_circ | ||
opac | ||
OpenILS | ||
patron_lists | ||
patroncards | ||
plugins | ||
reports | ||
reserve | ||
reviews | ||
rotating_collections | ||
selenium | ||
serials | ||
services | ||
skel | ||
sms | ||
suggestion | ||
svc | ||
t | ||
tags | ||
test | ||
tmp/modified_authorities | ||
tools | ||
virtualshelves | ||
xt | ||
.htaccess | ||
.mailmap | ||
about.pl | ||
changelanguage.pl | ||
edithelp.pl | ||
fix-perl-path.PL | ||
help.pl | ||
INSTALL | ||
install-CPAN.pl | ||
INSTALL.debian | ||
INSTALL.fedora7 | ||
INSTALL.opensuse | ||
INSTALL.ubuntu | ||
koha_perl_deps.pl | ||
kohaversion.pl | ||
LICENSE | ||
mainpage.pl | ||
Makefile.PL | ||
MANIFEST.SKIP | ||
README | ||
README.robots | ||
rewrite-config.PL |
Koha is a free software integrated library system. Koha is distributed under the GNU GPL version 3 or later. Please read the file LICENSE for more details. To install or upgrade Koha, please see the INSTALL file appropriate to your platform. Report bugs at http://bugs.koha-community.org/ Visit the Koha Project website at http://www.koha-community.org/