Bugzilla – Attachment 49269 Details for
Bug 16091
Can not delete branch category not used by any library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16091: Can not delete branch category not used by any library
Bug-16091-Can-not-delete-branch-category-not-used-.patch (text/plain), 1.42 KB, created by
Marc Véron
on 2016-03-17 14:10:50 UTC
(
hide
)
Description:
Bug 16091: Can not delete branch category not used by any library
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-03-17 14:10:50 UTC
Size:
1.42 KB
patch
obsolete
>From b90e2c902fe2f4cd2f9f5a18101968dfc22506b0 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Thu, 17 Mar 2016 15:01:48 +0100 >Subject: [PATCH] Bug 16091: Can not delete branch category not used by any > library > >Test plan > >Without patch: >- Go to Home > Administration > Libraries and groups >- Create a new group (make sure that you give it a Category code, see Bug 16047) >- Do not assign any library to this group >- Try to delete the group >Result: >"This library category cannot be deleted. 0 libraries are still using it." > >With patch: >- Try to delete the group >Result OK: Confirmation dialog for deletion. >- Try to delete a group that is assigned to a library >Result OK: "This library category cannot be deleted. 1 libraries are still using it." >--- > admin/branches.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/admin/branches.pl b/admin/branches.pl >index e5b2f52..ebaa0ef 100755 >--- a/admin/branches.pl >+++ b/admin/branches.pl >@@ -194,7 +194,8 @@ 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 ) ) { >+ my $libraries_count = scalar( $category->libraries ); >+ if ( $libraries_count > 0 ) { > push @messages, > { type => 'error', > code => 'cannot_delete_category', >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16091
:
49269
|
49279