In pretty much all areas of Koha, if you delete something (item, patron, setting, authorised values, etc.) you must confirm the deletion. When you delete a saved report, the report just deletes. Could a confirmation message be added, before the deletion happens? 1. Go to Saved Reports. 2. Create a new report and save it. 3. Go back to Saved Reports and find the report you just created . 4. Click on the Actions menu for that report, and choose Delete. 5. Note that the report deletes without a confirmation message.
FYI: when you select multiple reports to delete from the saved SQL reports page, and click the "Delete selected" button, you do get a "Are you sure you want to delete the selected reports?" confirmation message. The issue is with individual report deletion -- no delete confirmation message is triggered there.
Heather can you please check this again? In my tests 3.18.x and master there is already a delete confirmation warning. It is possible that a JavaScript error elsewhere on the page is short-circuiting the confirmation. Do you have custom JS in your staff client system preferences which might be causing problems?
Same here, I cannot recreate on master. Heather, please provide more details if it still happens.
Ok got it! It happens when you want to delete a report which is not displayed initially (pagination).
Created attachment 46389 [details] [review] Bug 15299: Ask for confirmation when deleting a report from second page Some link are hidden when loading the page, by DataTables, we need to use the delegate jQuery method to attach a handler to the click event for all delete links (the ones existing when loading the page, and the ones displayed in the future). Test plan: Have more than 20 reports defined Go on the report list view, then change the number of elements displayed, click "action>delete". You should get a warn.
Just noting that clicking the delete button from the Run, Edit, or Show views also doesn't prompt for confirmation. But this patch adds a confirm for deleting from the list, and that's good! Liz
Created attachment 46413 [details] [review] Bug 15299: Ask for confirmation when deleting a report from second page Some link are hidden when loading the page, by DataTables, we need to use the delegate jQuery method to attach a handler to the click event for all delete links (the ones existing when loading the page, and the ones displayed in the future). Test plan: Have more than 20 reports defined Go on the report list view, then change the number of elements displayed, click "action>delete". You should get a warn. Signed-off-by: Liz Rea <liz@catalyst.net.nz> Confirm that there is now a confirmation on delete from the list -> action menu
adds back the confirm for ones that are not initially displayed, I mean
Actually sorry I was wrong, it works fine on the show page.
(In reply to Liz Rea from comment #9) > Actually sorry I was wrong, it works fine on the show page. I have tested all others and they worked, please confirm you don't get the warn somewhere.
Created attachment 46428 [details] [review] Bug 15299: Ask for confirmation when deleting a report from second page Some link are hidden when loading the page, by DataTables, we need to use the delegate jQuery method to attach a handler to the click event for all delete links (the ones existing when loading the page, and the ones displayed in the future). Test plan: Have more than 20 reports defined Go on the report list view, then change the number of elements displayed, click "action>delete". You should get a warn. Signed-off-by: Liz Rea <liz@catalyst.net.nz> Confirm that there is now a confirmation on delete from the list -> action menu Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to Master - Should be in the May 2016 release. Thanks!
Patch pushed to 3.22.x, will be in 3.22.3
This patch has been pushed to 3.20.x, will be in 3.20.9.