Bug 5004 - Do not block deletion of cities when instances exist in borrowers table
Summary: Do not block deletion of cities when instances exist in borrowers table
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Owen Leonard
QA Contact: Bugs List
URL: /cgi-bin/koha/admin/cities.pl?op=dele...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 16:43 UTC by Owen Leonard
Modified: 2010-12-17 21:41 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed fix for HEAD (2.96 KB, patch)
2010-08-16 19:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Proposed fix for roadtype.pl (1.32 KB, patch)
2010-11-15 15:16 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2010-07-14 16:43:03 UTC
When you try to delete a city Koha does a check for entries in the borrowers table which match that city:

select count(*) as total from borrowers,cities where borrowers.city=cities.city_name and cityid=?

But why shouldn't it be possible to delete a city whether or not there are entries in borrowers? Nothing is preventing me from continuing to add patrons with that city manually, typing in the city details myself.
Comment 1 Owen Leonard 2010-08-16 19:30:32 UTC
Created attachment 2527 [details] [review]
Proposed fix for HEAD
Comment 2 Galen Charlton 2010-11-15 13:10:28 UTC
Signed off on patch.  I note that admin/roadtype.pl has the same issue.
Comment 3 Owen Leonard 2010-11-15 15:16:43 UTC
Created attachment 2757 [details] [review]
Proposed fix for roadtype.pl

Accompanying (but not dependent) patch for roadtype.pl

The road types interface didn't block deletion of road types in use, but the script included the same queries that cities.pl did, as if it intended to.
Comment 4 Chris Cormack 2010-11-18 20:53:57 UTC
Pushed, please test and close
Comment 5 Chris Nighswonger 2010-11-30 13:49:36 UTC
This bug has a fix which was committed to the 3.2.x branch and released in 3.2.1.

Please take time to update the status of this bug and mark it RESOLVED FIXED so that it may be closed.
Comment 6 MJ Ray (software.coop) 2010-12-09 15:10:20 UTC
This bug is mentioned in:
Fix for Bug 5004,	Don't block deletion of cities when instances exist in borrowers	table http://lists.koha-community.org/pipermail/koha-patches/2010-November/013013.html
Another bug 5004 fix,	this time for road types http://lists.koha-community.org/pipermail/koha-patches/2010-November/013016.html
Another bug 5004 fix,	this time for road types http://lists.koha-community.org/pipermail/koha-patches/2010-November/013028.html