From d754973045e455d78b9c919f525f6e854d2ab891 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 --- tools/modborrowers.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 2eb4dbf5af5..36c893b4163 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.25.1