https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15421 introduced a feature that is a little buggy. The menu is altered by some reports. I will attach some examples shortly. Basically, the new menu in Koha 3.22.6 added the ability to duplicate the report from within the report, not just on the report listing table. However, some of our reports are causing the menu to be altered. Here is one of our reports that causes the failure: SELECT CONCAT_WS(' ',authorised_values.lib,av2.lib) AS 'Status',reserves.reservenotes AS Notes,concat(biblio.title, ' ',ExtractValue(bi.marcxml, '//datafield[@tag="245"]/subfield[@code="b"]')) AS 'Title',biblio.author AS 'Author',items.location AS 'Location',items.itemcallnumber AS 'Call Number',items.barcode AS 'Barcode',CONCAT_WS(', ',borrowers.surname,borrowers.firstname) AS 'Patron',reserves.branchcode AS 'Send To',reserves.reservedate AS 'Date',if(reserves.itemnumber IS NULL,'Next Available','Item Level') AS 'Type',Date(Now()) AS 'Report Date' FROM (((((reserves INNER JOIN biblio ON reserves.biblionumber = biblio.biblionumber) INNER JOIN borrowers ON reserves.borrowernumber = borrowers.borrowernumber) INNER JOIN items ON biblio.biblionumber = items.biblionumber) LEFT JOIN biblioitems bi ON (biblio.biblionumber=bi.biblionumber) LEFT JOIN hold_fill_targets ON (reserves.biblionumber = hold_fill_targets.biblionumber) AND (reserves.borrowernumber = hold_fill_targets.borrowernumber)) LEFT JOIN branchtransfers ON items.itemnumber = branchtransfers.itemnumber) LEFT JOIN authorised_values ON items.itemlost = authorised_values.authorised_value LEFT JOIN authorised_values av2 ON items.damaged = av2.authorised_value WHERE (((authorised_values.category)="LOST") AND reserves.suspend=0 And ((av2.category="DAMAGED")) And ((reserves.reservedate)<=now()) And ((reserves.waitingdate) Is Null) And ((reserves.priority)=1) And ((items.itemnumber NOT IN (SELECT itemnumber FROM reserves WHERE itemnumber=items.itemnumber AND found IS NOT NULL))) And ((items.notforloan)=0) And ((items.damaged)=0) And ((items.itemlost)=0) And ((items.withdrawn)=0) And ((items.onloan) Is Null) And ((reserves.itemnumber) Is Not Null And (reserves.itemnumber)=items.itemnumber) And ((items.itype)<>"REF") And ((hold_fill_targets.itemnumber) Is Null)) Or (((authorised_values.category)="LOST") And ((av2.category="DAMAGED")) And ((hold_fill_targets.itemnumber)=items.itemnumber)) And ((reserves.found) IS NULL) AND reserves.suspend=0 GROUP BY items.holdingbranch, items.itemcallnumber, items.enumchron, biblio.author, biblio.title, items.barcode, reserves.branchcode HAVING items.holdingbranch=<<Branch filled at|branches>> And Count(branchtransfers.datesent)=Count(branchtransfers.datearrived) ORDER BY items.location, items.itemcallnumber, items.enumchron, biblio.author, biblio.title ASC Christopher
Created attachment 51340 [details] Snapshot of menu failure
Created attachment 51341 [details] Snapshot of good menu (how it should look)
Created attachment 51343 [details] [review] Bug 16481 - Report menu has unexpected issues This patch corrects a problem with the reports toolbar include file which can cause a problem with the "duplicate" button. The duplicate button passes the entire report SQL as a URL parameter, but the template variable was not escaped as a URL variable. This patch also adds the "uri" filter to the report name and notes fields just to be safe. To reproduce the bug, create a new SQL report using the SQL in the bug report. When you run the report you should see a broken "Duplicate" button. Apply the patch and run the report again. The duplicate button should look correct and work correctly.
Created attachment 51352 [details] [review] [SIGNED-OFF] Bug 16481 - Report menu has unexpected issues This patch corrects a problem with the reports toolbar include file which can cause a problem with the "duplicate" button. The duplicate button passes the entire report SQL as a URL parameter, but the template variable was not escaped as a URL variable. This patch also adds the "uri" filter to the report name and notes fields just to be safe. To reproduce the bug, create a new SQL report using the SQL in the bug report. When you run the report you should see a broken "Duplicate" button. Apply the patch and run the report again. The duplicate button should look correct and work correctly. Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Created attachment 51404 [details] [review] Bug 16481 - Report menu has unexpected issues This patch corrects a problem with the reports toolbar include file which can cause a problem with the "duplicate" button. The duplicate button passes the entire report SQL as a URL parameter, but the template variable was not escaped as a URL variable. This patch also adds the "uri" filter to the report name and notes fields just to be safe. To reproduce the bug, create a new SQL report using the SQL in the bug report. When you run the report you should see a broken "Duplicate" button. Apply the patch and run the report again. The duplicate button should look correct and work correctly. Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for Koha 16.05, thanks Owen!
Patch pushed to 3.22.x, will be in 3.22.7