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: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 37188
Blocks:
  Show dependency treegraph
 
Reported: 2025-10-02 12:29 UTC by Andrew Fuerste-Henry
Modified: 2025-10-02 12:43 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
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

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
Created attachment 187268 [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