From 0018fe8fba99ea200c6ac2924b9e5aff83e64af5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 18 Sep 2023 19:03:37 +0200 Subject: [PATCH] Bug 34818: (bug 21083 follow-up) Fix batch patron modification tool It is not possible to perform batch patron modification without selecting a patron attribute Test plan: Test the batch patron modification tool, with or without extended attributes. The error was Can't call method "category_code" on an undefined value at /kohadevbox/koha/tools/modborrowers.pl line 407 Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- tools/modborrowers.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 2eb4dbf5af..36c893b416 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -403,6 +403,9 @@ if ( $op eq 'do' ) { for my $code ( keys %$attributes ) { my $attr_type = Koha::Patron::Attribute::Types->find($code); + + next unless $attr_type; + # If this borrower is not in the category of this attribute, we don't want to modify this attribute next if $attr_type->category_code and $attr_type->category_code ne $patron->categorycode; -- 2.39.5