Browse Source

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 <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7ce6f78956)
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
remotes/origin/19.11.x
Jonathan Druart 4 years ago
committed by Aleisha Amohia
parent
commit
a3d5e03d26
  1. 11
      admin/patron-attr-types.pl

11
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;

Loading…
Cancel
Save