Bug 21083 moved from a loop of checking disabled attributes to a grep. When looping we did ++$i for each iteration For the grep we need to check the current i before incrementing, but we are doing the increment first here: $attributes->{$code}->{disabled} = grep { $_ eq sprintf("attr%s_value", ++$i) } @disabled; Just need to move the pluses to the right
Created attachment 173304 [details] [review] 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
Created attachment 173348 [details] [review] 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, restart_all 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 <phil@chetcolibrary.org>
Created attachment 173579 [details] [review] 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 <phil@chetcolibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Pushed for 24.11! Well done everyone, thank you!
This is needed for 23.11 and 23.05 too
Backported to 24.05.x for upcoming 24.05.06
Pushed to 23.11.x for 23.11.11
Not pushed to LTS. Marked Resolved. If you feel this should be in LTS please reply with your reason.