From d913d5ab79c51c262ca16fdb5b938969921eb168 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Fri, 21 Jun 2024 12:05:11 -0700 Subject: [PATCH] Bug 37152: Deleting patron categories doesn't warn about categories in use You can't delete a patron category when it is in use, but because the script which handles delete confirmation is expecting the wrong op, cud-delete_confirm rather than delete_confirm, you don't get any warning, just a failure to delete error message. Test plan: 1. Without the patch, Administration - Patron categories 2. On the row for Staff, click Delete, Delete this category 3. Note an error message telling you to check the logs for details 4. Apply patch, restart_all 5. With the patch, repeat steps 1-2, note that instead of a button for Delete this category you get a warning that it is in use 6. In the list of categories, row for Board, click Delete, Delete this category 7. Note that the (unused) Board category was deleted Signed-off-by: Emily Lamancusa Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- admin/categories.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/categories.pl b/admin/categories.pl index 5495210b6d..c89fce0fba 100755 --- a/admin/categories.pl +++ b/admin/categories.pl @@ -168,7 +168,7 @@ elsif ( $op eq 'cud-add_validate' ) { $searchfield = q||; $op = 'list'; } -elsif ( $op eq 'cud-delete_confirm' ) { +elsif ( $op eq 'delete_confirm' ) { my $count = Koha::Patrons->search({ categorycode => $categorycode -- 2.39.5