Bug 40937 - No option to show/hide data menu in report results when including borrowernumber
Summary: No option to show/hide data menu in report results when including borrowernumber
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Andrew Fuerste-Henry
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on: 37188
Blocks:
  Show dependency treegraph
 
Reported: 2025-10-02 12:29 UTC by Andrew Fuerste-Henry
Modified: 2025-11-10 15:06 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.05,24.11.11
Circulation function:


Attachments
Bug 40937: Include show data menu button for batch_borrowernumbers (2.21 KB, patch)
2025-10-02 12:43 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 40937: Include show data menu button for batch_borrowernumbers (2.28 KB, patch)
2025-10-16 06:46 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 40937: Include show data menu button for batch_borrowernumbers (2.34 KB, patch)
2025-10-16 19:12 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2025-10-02 12:29:39 UTC
When borrowernumber was added as an option for batch patron action from reports, it didn't get added to the IF statement that makes the Show/Hide Data Menus button appear. It only knows to show up for cardnumber, biblionumber, itemnumber, or reserve_id.
(https://github.com/Koha-Community/Koha/blob/99283025fc4ca0fa1c096344a47b380f75d8fe76/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt#L1265)

In a fun little twist, we told Koha to not set batch_cardnumbers if batch_borrowernumbers was already set, to stop the batch operations from showing up twice.
(https://github.com/Koha-Community/Koha/blob/99283025fc4ca0fa1c096344a47b380f75d8fe76/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt#L1054)

To recreate:
1 - save and run "SELECT borrowernumber FROM borrowers" - no Show/Hide button
2 - save and run "SELECT cardnumber FROM borrowers" - yes Show/Hide button!
3 - save and run "SELECT cardnumber, borrowernumber FROM borrowers" - no Show/Hide button
4 - save and run "SELECT cardnumber, borrowernumber, itemnumber FROM issues LEFT JOIN borrowers USING (borrowernumber)" - yes Show/Hide button!
Comment 1 Andrew Fuerste-Henry 2025-10-02 12:43:53 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2025-10-16 06:46:00 UTC
Created attachment 187947 [details] [review]
Bug 40937: Include show data menu button for batch_borrowernumbers

To test:
1 - save and run a report of "SELECT borrowernumber FROM borrowers"
2 - observe your results page does not include the Show Data Menu button
3 - save and run a report of "SELECT cardnumber FROM borrowers"
4 - observe your results page does include the button
5 - save and run a report of "SELECT borrowernumber, cardnumber FROM borrowers"
6 - observe you are once again buttonless on the results page
7 - apply patch
8 - run your report from step 1, observe you now have the button
9 - run your report from step 3, observe you still have the button
10 - run your report from step 5, observe you now have the button
11 - confirm that the batch actions dropdown only includes the patron actions once

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Comment 3 Nick Clemens (kidclamp) 2025-10-16 19:12:21 UTC
Created attachment 188029 [details] [review]
Bug 40937: Include show data menu button for batch_borrowernumbers

To test:
1 - save and run a report of "SELECT borrowernumber FROM borrowers"
2 - observe your results page does not include the Show Data Menu button
3 - save and run a report of "SELECT cardnumber FROM borrowers"
4 - observe your results page does include the button
5 - save and run a report of "SELECT borrowernumber, cardnumber FROM borrowers"
6 - observe you are once again buttonless on the results page
7 - apply patch
8 - run your report from step 1, observe you now have the button
9 - run your report from step 3, observe you still have the button
10 - run your report from step 5, observe you now have the button
11 - confirm that the batch actions dropdown only includes the patron actions once

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Lucas Gass (lukeg) 2025-10-20 16:14:31 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 5 Paul Derscheid 2025-10-29 09:10:11 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 6 Fridolin Somers 2025-11-10 15:06:39 UTC
Pushed to 24.11.x for 24.11.11