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 <srdjan@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
Jonathan Druart 2016-03-09 12:21:14 +00:00 committed by Brendan Gallagher
parent 7aedcf643e
commit 99f2feeed9
1 changed files with 1 additions and 1 deletions

View File

@ -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',