From 261e26cbd176f314e2ead91a76f22d965a01c702 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 May 2020 15:30:35 +0200 Subject: [PATCH] Bug 25567: Prevent patron category type's categorycode to be created with "" It must be NULL/undef, the default from the DB. The method Koha::Patron::Attribute::Type->categorycode is not covered by tests! To recreate: Create a new patron attribute type, don't select a patron's category (and not repeatable or unique) Go to the batch patron modification tool, enter a cardnumber, next. => boom! Apply the patch, edit the patron attribute, save Go to the batch patron modification tool, enter a cardnumber, next. => success! --- admin/patron-attr-types.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index b923638427..8aab052be4 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -122,7 +122,7 @@ sub add_update_attribute_type { my $staff_searchable = $input->param('staff_searchable') ? 1 : 0; my $authorised_value_category = $input->param('authorised_value_category'); my $display_checkout = $input->param('display_checkout') ? 1 : 0; - my $category_code = $input->param('category_code'); + my $category_code = $input->param('category_code') || undef; my $class = $input->param('class'); my $attr_type = Koha::Patron::Attribute::Types->find($code); -- 2.20.1