Bug 35817: Fix hint on patron's category when batch update patron

When a patron's attribute is limited to a given patron's category, the
batch patron modification tool will display a hint "This attribute will
be only applied to the patron's category %s". But this is followed by
the description of the patron's attribute, not the patron's category.

Test plan:
Create a patron's attribute "Color of hair" and select a patron
category (Patron).
Batch edit batch and select "Color of hair"
A hint will be display.
=> Without this patch the hint is "This attribute will be only applied
   to the patron's category Color of hair"
=> With this patch it will be corrected to "This attribute will be only
   applied to the patron's category Patron"

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 074684eaf4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5809d746d4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2024-01-16 13:41:59 +01:00 committed by Lucas Gass
parent caa21f9fba
commit 49256cb484
1 changed files with 3 additions and 3 deletions

View File

@ -150,9 +150,9 @@ if ( $op eq 'show' ) {
};
my $category_code = $attr_type->category_code;
my ( $category_lib ) = map {
( defined $category_code and $attr_type->category_code eq $category_code ) ? $attr_type->description : ()
} @patron_categories;
my ($category_lib) =
map { ( defined $category_code and $attr_type->category_code eq $_->categorycode ) ? $_->description : () }
@patron_categories;
push @patron_attributes_codes,
{
attribute_code => $attr_type->code,