Main Koha release repository https://koha-community.org
Find a file
Fridolyn SOMERS d000a71635 Bug 11338: prevent deletion of items that are captured for holds
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>
2013-12-25 17:15:08 +00:00
acqui Bug 9948: fix creation/updating of items when partially receiving an order 2013-12-23 16:02:32 +00:00
admin Bug 11166: make library filter in funds administration page more precise 2013-12-20 22:49:47 +00:00
authorities
basket
C4 Bug 11338: prevent deletion of items that are captured for holds 2013-12-25 17:15:08 +00:00
catalogue
cataloguing Bug 11410: ensure cataloging search finds results for searches with ampersands 2013-12-21 00:33:09 +00:00
circ Bug 2693: add ability to filter by reviewer name on tag review page 2013-12-02 15:58:04 +00:00
course_reserves
debian Bug 10735: prevent koha-dump from aborting if backupdir undefined 2013-12-23 15:55:03 +00:00
docs
errors
etc Bug 9940: (follow-up) add language-original to QP search field list 2013-12-25 15:49:48 +00:00
install_misc Bug 8798: DBIx::Class base classes for all Koha tables 2013-10-14 21:07:24 +00:00
installer Bug 6331: DBRev 3.15.00.010 2013-12-23 16:38:20 +00:00
Koha Bug 6331: (follow-up) update DBIC schema classes 2013-12-23 16:39:58 +00:00
koha-tmpl Bug 11004: Make xmlControlfield.js use the marcflavour syspref to look for XML files 2013-12-25 16:02:57 +00:00
labels Bug 11222: fix crash that can occur in search for items to add to label batch 2013-11-23 19:54:38 +00:00
members
misc Bug 11417: make sure remove_unused_authorities.pl accepts --test 2013-12-19 15:09:18 +00:00
offline_circ
opac
OpenILS Bug 9239 QA follow-up: remove stray debug code 2013-03-16 21:32:34 -04:00
patron_lists
patroncards
plugins
reports
reserve Bug 10663: QA Followup: Typo in comment in renewscript 2013-08-16 01:39:16 +00:00
reviews Bug 1623 - Provide view of approved comments 2011-12-27 18:26:50 +01:00
rotating_collections Bug 9605: rotating collections permissions are wrong 2013-03-30 22:11:05 -04:00
selenium Adding selenium tests for filterMembers 2009-09-30 11:30:37 +02:00
serials
services
skel
sms
suggestion Bug 9261: (follow-up) remove reference to deprecated DHTMLcalendar 2013-11-15 00:23:59 +00:00
svc Bug 7813: (follow-up) improvements for deleting local cover images 2013-09-21 18:11:13 +00:00
t Bug 11338: add unit tests for DelItemCheck 2013-12-25 17:07:53 +00:00
tags
test Bug 5449: JSON malformed in Koha - Blocker with jQuery 1.4.x 2011-03-12 08:53:41 +13:00
tmp/modified_authorities
tools
virtualshelves Bug 10853: All existing routing to get a CSV should return a MARC csv 2013-10-11 02:16:33 +00:00
xt Bug 11304: fix display of detail page holdings tab in translated Bootstrap theme 2013-11-27 16:52:02 +00:00
.htaccess
.mailmap 7439 Mailmap for master 2012-01-27 12:27:58 +01:00
about.pl
changelanguage.pl
edithelp.pl 7368 Typo in edithelp.pl warning 2013-04-18 09:47:58 -04:00
fix-perl-path.PL installer: improvements to fix-path-perl.PL on Win32 2007-12-20 19:20:12 -06:00
help.pl
INSTALL
install-CPAN.pl Bug 5370: Fix all the references to koha.org 2010-11-08 09:41:49 +13:00
INSTALL.debian
INSTALL.fedora7 Bug 7440 - Remove NoZebra vestiges 2013-03-19 21:17:04 -04:00
INSTALL.opensuse
INSTALL.ubuntu
koha_perl_deps.pl
kohaversion.pl Bug 6331: DBRev 3.15.00.010 2013-12-23 16:38:20 +00:00
LICENSE
mainpage.pl
Makefile.PL Bug 10565: (follow-up) ensure that new patron_lists/ CGI directory is installed 2013-10-14 22:44:23 +00:00
MANIFEST.SKIP
README Bug 9440 - update Koha's LICENSE file from GPL2 to GPL3 2013-02-12 08:52:10 -05:00
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/