From 1bf0d71710f52d7e398e8cb89808aa23de65fed5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 May 2020 15:35:33 +0200 Subject: [PATCH] Bug 25567: Fix typo categorycode vs category_code Well, this is actually the real root of the error! Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit 4e945dff87a8bc4badb605361c1db63f71b04a07) Signed-off-by: Aleisha Amohia --- tools/modborrowers.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index eaa93eaf8f..96c19ebb94 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -120,8 +120,8 @@ if ( $op eq 'show' ) { my $attr_type = C4::Members::AttributeTypes->fetch( $_->{code} ); # TODO Repeatable attributes are not correctly managed and can cause data lost. # This should be implemented. - next if $attr_type->{repeatable}; - next if $attr_type->{unique_id}; # Don't display patron attributes that must be unqiue + next if $attr_type->repeatable; + next if $attr_type->unique_id; # Don't display patron attributes that must be unqiue my $options = $attr_type->authorised_value_category ? GetAuthorisedValues( $attr_type->authorised_value_category ) : undef; @@ -131,14 +131,14 @@ if ( $op eq 'show' ) { options => $options, }; - my $category_code = $_->{category_code}; + my $category_code = $attr_type->category_code; my ( $category_lib ) = map { - ( defined $category_code and $_->categorycode eq $category_code ) ? $_->description : () + ( defined $category_code and $attr_type->category_code eq $category_code ) ? $attr_type->description : () } @patron_categories; push @patron_attributes_codes, { attribute_code => $_->{code}, - attribute_lib => $_->{description}, + attribute_lib => $attr_type->description, category_lib => $category_lib, type => $attr_type->authorised_value_category ? 'select' : 'text', }; @@ -346,7 +346,7 @@ if ( $op eq 'do' ) { $attribute->{attribute} = $attr_values[$i]; my $attr_type = C4::Members::AttributeTypes->fetch( $_ ); # If this borrower is not in the category of this attribute, we don't want to modify this attribute - ++$i and next if $attr_type->{category_code} and $attr_type->{category_code} ne $borrower_categorycode; + ++$i and next if $attr_type->category_code and $attr_type->category_code ne $borrower_categorycode; my $valuename = "attr" . $i . "_value"; if ( grep { /^$valuename$/ } @disabled ) { # The attribute is disabled, we remove it for this borrower ! -- 2.39.5