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.
Created attachment 2527 [details] [review] Proposed fix for HEAD
Signed off on patch. I note that admin/roadtype.pl has the same issue.
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.
Pushed, please test and close
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.
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