Bug 37188

Summary: Batch patron modification from report results should be an option when borrowernumber is selected
Product: Koha Reporter: hebah
Component: ReportsAssignee: Nick Clemens (kidclamp) <nick>
Status: Needs documenting --- QA Contact: Pedro Amorim <pedro.amorim>
Severity: enhancement    
Priority: P5 - low CC: laura, lucas, nick, oleonard, pedro.amorim, phil
Version: 24.05   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 37197    
Bug Blocks:    
Attachments: Bug 37188: Allow batch modification of borrowers from reports with cardnumber or borrowernumber
Bug 37188: Allow batch modification of borrowers from reports with cardnumber or borrowernumber
Bug 37188: Allow batch modification of borrowers from reports with cardnumber or borrowernumber

Description hebah 2024-06-25 21:08:57 UTC
To recreate: run a report using borrowernumber as one of the columns. Select batch actions from visible results. See that batch patron modification is not an option. Confirmed change in behavior from 23.11.
Comment 1 Phil Ringnalda 2024-06-26 14:22:08 UTC
Are you *sure* that's a change from 23.11? Bug 29181 made the decision to show patron card creator when you select borrowernumber, and to show batch patron modification when you select cardnumber, and thus to only show both when you select borrowernumber, cardnumber, and that bug says it landed in 23.11 so it should be a change from 23.05 to 23.11.

Certainly a regression in 24.05 that batch patron modification is broken since bug 34478 broke sending things to it by changing it from a POST which it accepts to a GET which it does not, though. Filed bug 37197 for that
Comment 2 Phil Ringnalda 2024-06-27 03:53:06 UTC
Bug 29181 comment 2 in the commit message said "The logic of the dropdown menu has been modified in order to ensure that duplicate patron modification options aren't shown in the menu when a report return both borrowernumber and cardnumber" but I don't see why that would occur. Batch patron modification can take either borrowernumber or cardnumber, so we should show it IF show_cardnumber_ops || show_borrowernumber_ops while patron card creator can only take borrowernumber so we should only show it IF show_borrowernumber_ops, and then if you select cardnumber you get batch patron modification only, if you select borrowernumber you get both, if you select both you get both.
Comment 3 Phil Ringnalda 2024-06-27 04:17:25 UTC
Oh, not quite so simple, since we have to know which sort of data we are sending to batch mod, and have a way to send it the thing we have from a particular report.

Still, if ( (borrowernumber and cardnumber) or (borrowernumber and 
!cardnumber)) batchmod_borrowernumber elseif (cardnumber) batchmod_cardnumber endif if (cardnumber) cardcreator_cardnumber isn't *that* messy.
Comment 4 Nick Clemens (kidclamp) 2024-07-25 17:32:04 UTC Comment hidden (obsolete)
Comment 5 Nick Clemens (kidclamp) 2024-07-25 17:58:00 UTC
Created attachment 169612 [details] [review]
Bug 37188: Allow batch modification of borrowers from reports with cardnumber or borrowernumber

Some libraries do not use cardnumbers for their patrons, but would still like to be able to batch
modify patrons from reports.

Borrowernumber is going to be authoritative - every borrower will have one - so if this column is
included in the results we should offer batch modification. If we have cardnumber, we can use that.
If we have both, we should use borrowernumber

To test:
 1 - Write a report like:
    SELECT cardnumber FROM borrowers ORDER BY rand() LIMIT 35
 2 - Run report
 3 - Click "Batch operations.." -> "Batch patron modification"
 4 - Confirm it works
 5 - Edit report:
    SELECT borrowernumber FROM borrowers ORDER BY rand() LIMIT 35
 6 - Run report
 7 - No option for batch modifying patrons
 8 - Apply patch
 9 - Run report
10 - The option for batch modificatoin now shows
11 - Confirm both batch operation types work from report
12 - Edit report:
   SELECT cardnumber,borrowernumber FROM borrowers ORDER BY rand() LIMIT 35
13 - Run report
14 - Confirm both batch operations work
Comment 6 ByWater Sandboxes 2024-07-26 14:24:52 UTC
Created attachment 169726 [details] [review]
Bug 37188: Allow batch modification of borrowers from reports with cardnumber or borrowernumber

Some libraries do not use cardnumbers for their patrons, but would still like to be able to batch
modify patrons from reports.

Borrowernumber is going to be authoritative - every borrower will have one - so if this column is
included in the results we should offer batch modification. If we have cardnumber, we can use that.
If we have both, we should use borrowernumber

To test:
 1 - Write a report like:
    SELECT cardnumber FROM borrowers ORDER BY rand() LIMIT 35
 2 - Run report
 3 - Click "Batch operations.." -> "Batch patron modification"
 4 - Confirm it works
 5 - Edit report:
    SELECT borrowernumber FROM borrowers ORDER BY rand() LIMIT 35
 6 - Run report
 7 - No option for batch modifying patrons
 8 - Apply patch
 9 - Run report
10 - The option for batch modificatoin now shows
11 - Confirm both batch operation types work from report
12 - Edit report:
   SELECT cardnumber,borrowernumber FROM borrowers ORDER BY rand() LIMIT 35
13 - Run report
14 - Confirm both batch operations work

Signed-off-by: Laura ONeil <laura@bywatersolutions.com>
Comment 7 Pedro Amorim 2024-07-29 09:51:05 UTC
Created attachment 169814 [details] [review]
Bug 37188: Allow batch modification of borrowers from reports with cardnumber or borrowernumber

Some libraries do not use cardnumbers for their patrons, but would still like to be able to batch
modify patrons from reports.

Borrowernumber is going to be authoritative - every borrower will have one - so if this column is
included in the results we should offer batch modification. If we have cardnumber, we can use that.
If we have both, we should use borrowernumber

To test:
 1 - Write a report like:
    SELECT cardnumber FROM borrowers ORDER BY rand() LIMIT 35
 2 - Run report
 3 - Click "Batch operations.." -> "Batch patron modification"
 4 - Confirm it works
 5 - Edit report:
    SELECT borrowernumber FROM borrowers ORDER BY rand() LIMIT 35
 6 - Run report
 7 - No option for batch modifying patrons
 8 - Apply patch
 9 - Run report
10 - The option for batch modificatoin now shows
11 - Confirm both batch operation types work from report
12 - Edit report:
   SELECT cardnumber,borrowernumber FROM borrowers ORDER BY rand() LIMIT 35
13 - Run report
14 - Confirm both batch operations work

Signed-off-by: Laura ONeil <laura@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 8 Katrin Fischer 2024-08-01 16:10:36 UTC
I am not sure if this is a regression really - I believe it was only cardnumber from the beginning when this feature was implemented.
Comment 9 Katrin Fischer 2024-08-01 16:27:17 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 10 Lucas Gass 2024-08-29 17:32:10 UTC
Enhancement will not be backported to 24.05.x