From 99f2feeed94cb88bb14653231735f35c0787cb27 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Mar 2016 12:21:14 +0000 Subject: [PATCH] Bug 16015: Restore the ability to delete a group of libraries If a group of libraries is linked to at least 1 library, the group cannot be delete and the librarian should get a warning message. But if no libraries are linked, the deletion should be allowed. Since bug 15294 this behavior is broken: The deletion is always blocked: "This library category cannot be deleted. 0 libraries are still using it", hum... Test plan: Create a group of libraries, delete it Signed-off-by: Srdjan Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- admin/branches.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/branches.pl b/admin/branches.pl index e5b2f52332..c2ec0877c8 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -194,7 +194,7 @@ if ( $op eq 'add_form' ) { $op = 'list'; } elsif ( $op eq 'delete_confirm_category' ) { my $category = Koha::LibraryCategories->find($categorycode); - if ( my $libraries_count = scalar( $category->libraries ) ) { + if ( my $libraries_count = $category->libraries->count ) { push @messages, { type => 'error', code => 'cannot_delete_category', -- 2.39.5