Bug 37328

Summary: Cannot delete report after using 'Update and run SQ' button
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: ReportsAssignee: CJ Lynce <cj.lynce>
Status: RESOLVED FIXED QA Contact: Lucas Gass (lukeg) <lucas>
Severity: normal    
Priority: P5 - low CC: cj.lynce, david, emmi.takkinen, kebliss, marie.hedbom, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes deleting saved reports, and adds a confirmation message. Before this, attempting to delete a saved report (Edit > Delete) did not do anything.
Version(s) released in:
24.11.00
Circulation function:
Attachments: Bug 37328: Cannot delete report after using Update and Run SQL button
Bug 37328: Cannot delete report after using Update and Run SQL button
Bug 37328: Cannot delete report after using Update and Run SQL button
Bug 37328: Cannot delete report after using Update and Run SQL button
Bug 37328: Cannot delete report after using Update and Run SQL button

Description Andrew Fuerste-Henry 2024-07-11 14:00:36 UTC
To recreate:
- create a report or edit an existing one
- on the edit screen (/cgi-bin/koha/reports/guided_reports.pl?id=XXX&op=edit_form), click "Update and run SQL"
- On the resulting page, where you see both your results and the edit form, click Edit and then Delete
- Nothing happens. The delete confirm modal doesn't appear, so the deletion doesn't move forward.


The url on that results + edit screen is just "/cgi-bin/koha/reports/guided_reports.pl" -- I don't know if that's part of the issue?

The report can still be deleted from other pages.
Comment 1 Katie Bliss 2024-07-17 16:24:13 UTC
It also seems that the Rows Per Page button doesn't work after clicking Update and Run SQL. Same as what Andrew describes above, after Update and Run, click on Rows Per Page and select a different number of rows--nothing happens. Though if I rerun the report (with the Run Report button at the top), the Rows Per Page button does work as normal.
Comment 2 CJ Lynce 2024-08-29 14:57:54 UTC Comment hidden (obsolete)
Comment 3 CJ Lynce 2024-08-29 15:08:20 UTC
Created attachment 170874 [details] [review]
Bug 37328: Cannot delete report after using Update and Run SQL button

Fixes the ability to delete a report from the report toolbar menu after running
	the report, including displaying the delete confirm modal.

To test:
1) Login to staff client
2) Navigate to Reports -> Create from SQL
3) Create a short report (SELECT * FROM items), name it and SAVE it.
4) On the resulting "Edit SQL report' page, click 'Update and run SQL'
5) On the toolbar, click Edit -> Delete
	Nothing happens
6) Apply patch
7) Return to Reports -> Saved Reports and Edit the report you created.
8) On "Edit SQL report' page, click 'Update and run SQL'
9) On the toolbar, click Edit -> Delete
10) Confirm the delete modal.
	The report is now deleted.

Sponsored-by: Westlake Porter Public Library
Comment 4 CJ Lynce 2024-08-29 15:09:56 UTC
It appears that the Rows per page issue has a resolution incoming over on bug_37745
Comment 5 CJ Lynce 2024-08-29 15:55:08 UTC
Also, I tried applying this patch on 24.05.03, but it would not work. Turns out, in 24.05, the delete button issue is related to the issue on bug 37763, and that patch fixes the delete button after Update and run SQL.

Main also had issues with the delete button, for a completely separate reason, which this patch fixed.
Comment 6 David Nind 2024-09-08 22:11:49 UTC
Created attachment 171167 [details] [review]
Bug 37328: Cannot delete report after using Update and Run SQL button

Fixes the ability to delete a report from the report toolbar menu after running
	the report, including displaying the delete confirm modal.

To test:
1) Login to staff client
2) Navigate to Reports -> Create from SQL
3) Create a short report (SELECT * FROM items), name it and SAVE it.
4) On the resulting "Edit SQL report' page, click 'Update and run SQL'
5) On the toolbar, click Edit -> Delete
	Nothing happens
6) Apply patch
7) Return to Reports -> Saved Reports and Edit the report you created.
8) On "Edit SQL report' page, click 'Update and run SQL'
9) On the toolbar, click Edit -> Delete
10) Confirm the delete modal.
	The report is now deleted.

Sponsored-by: Westlake Porter Public Library
Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Emmi Takkinen 2024-09-19 11:58:32 UTC
Created attachment 171715 [details] [review]
Bug 37328: Cannot delete report after using Update and Run SQL button

Fixes the ability to delete a report from the report toolbar menu after running
	the report, including displaying the delete confirm modal.

To test:
1) Login to staff client
2) Navigate to Reports -> Create from SQL
3) Create a short report (SELECT * FROM items), name it and SAVE it.
4) On the resulting "Edit SQL report' page, click 'Update and run SQL'
5) On the toolbar, click Edit -> Delete
	Nothing happens
6) Apply patch
7) Return to Reports -> Saved Reports and Edit the report you created.
8) On "Edit SQL report' page, click 'Update and run SQL'
9) On the toolbar, click Edit -> Delete
10) Confirm the delete modal.
	The report is now deleted.

Sponsored-by: Westlake Porter Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Comment 8 Emmi Takkinen 2024-09-20 06:42:06 UTC
I think this still needs a minor fix on UI. After applying the patch the "Delete" option on dropdown menus isn't applied neatly to the element. It doesn't have enough margin around it and if I hover to the right side of the menu, I'm unable to select it. I have to move my mouse exactly above the text.
Comment 9 Emmi Takkinen 2024-09-20 06:45:56 UTC
(In reply to Emmi Takkinen from comment #8)
> I think this still needs a minor fix on UI. After applying the patch the
> "Delete" option on dropdown menus isn't applied neatly to the element. It
> doesn't have enough margin around it and if I hover to the right side of the
> menu, I'm unable to select it. I have to move my mouse exactly above the
> text.

Forget this, it was a problem with my UI. I didn't remember to run yarn build on my other test environment. On current master this works as expected and UI looks clean.
Comment 10 Lucas Gass (lukeg) 2024-09-20 17:03:27 UTC
Created attachment 171838 [details] [review]
Bug 37328: Cannot delete report after using Update and Run SQL button

Fixes the ability to delete a report from the report toolbar menu after running
	the report, including displaying the delete confirm modal.

To test:
1) Login to staff client
2) Navigate to Reports -> Create from SQL
3) Create a short report (SELECT * FROM items), name it and SAVE it.
4) On the resulting "Edit SQL report' page, click 'Update and run SQL'
5) On the toolbar, click Edit -> Delete
	Nothing happens
6) Apply patch
7) Return to Reports -> Saved Reports and Edit the report you created.
8) On "Edit SQL report' page, click 'Update and run SQL'
9) On the toolbar, click Edit -> Delete
10) Confirm the delete modal.
	The report is now deleted.

Sponsored-by: Westlake Porter Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 11 Martin Renvoize (ashimema) 2024-09-30 14:34:07 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 12 Lucas Gass (lukeg) 2024-11-18 22:24:36 UTC
Doesn't apply clean to 24.05.x, please rebase if needed.