From baecb3f70cd416f94df3865a0fa4b25a8bc16add Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Mar 2016 12:21:14 +0000 Subject: [PATCH] [PASSED QA] 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 --- admin/branches.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/branches.pl b/admin/branches.pl index e5b2f52..c2ec087 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', -- 1.9.1