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!
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