From a62953aa9ee8c5ac80e6e5cc6dd5300725b89e5e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 24 Oct 2024 18:17:54 +0000 Subject: [PATCH] Bug 38266: (bug 21083 follow-up) Increment after comparison To test: 1 - Define a patron attribute as repeatable 2 - Add multiple values to a patron (I used borrowernumber 5) 3 - Tools->Batch patron modification 4 - Modify the patron from step 1, selecting the attribute you created and checking the box to clear 5 - View the patron, they look correct 6 - Check the DB: SELECT * FROM borrower_attributes WHERE borrowernumber=5; 7 - There is one blank value 8 - Apply patch 9 - Repeat batch modification 10 - Check the DB, no attribute! 11 - Test with multiple attributes in the batch modification and ensure only the correct one is removed 12 - Sign off Signed-off-by: Phil Ringnalda Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer --- tools/modborrowers.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 190fe94b2b..76dacafe53 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -419,7 +419,7 @@ if ( $op eq 'cud-do' ) { my $i = 0; for my $code (@attributes) { push @{ $attributes->{$code}->{values} }, shift @attr_values; # Handling repeatables - $attributes->{$code}->{disabled} = grep { $_ eq sprintf( "attr%s_value", ++$i ) } @disabled; + $attributes->{$code}->{disabled} = grep { $_ eq sprintf( "attr%s_value", $i++ ) } @disabled; } for my $code ( keys %$attributes ) { -- 2.39.5