From 2d12c22e2042dd28c0f4728a8864de2f36d49bde 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 --- admin/branches.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/branches.pl b/admin/branches.pl index e5b2f52..103a09c 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 = scalar( $category->libraries ) > 0 ) { push @messages, { type => 'error', code => 'cannot_delete_category', -- 2.7.0