From a3d5e03d26e1bc54a8a14765e670c4e77e98bdf6 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! Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit 7ce6f7895610913f35fb1531faa1a40cefcd5f88) Signed-off-by: Aleisha Amohia --- admin/patron-attr-types.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index 174bac5926..8658357571 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -144,6 +144,17 @@ sub add_update_attribute_type { my $template = shift; my $code = shift; + my $description = $input->param('description'); + my $repeatable = $input->param('repeatable') ? 1 : 0; + my $unique_id = $input->param('unique_id') ? 1 : 0; + my $opac_display = $input->param('opac_display') ? 1 : 0; + my $opac_editable = $input->param('opac_editable') ? 1 : 0; + 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') || undef; + my $class = $input->param('class'); + my $description = $input->param('description'); my $attr_type; -- 2.39.5