Bug 34650: Convert list toolbar delete into form POST
authorDavid Cook <dcook@prosentient.com.au>
Wed, 30 Aug 2023 00:28:53 +0000 (00:28 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 8 Sep 2023 00:37:02 +0000 (14:37 -1000)
commit0c4fe03c2331e2fc255e955312fcd4c5c9606225
tree8d8c5a97d41f9df092502e01d6074c6cf63997d6
parente81e765d7da1b3e34ba4976c2fa6264e658d0044
Bug 34650: Convert list toolbar delete into form POST

This patch adds a HTML form with a CSRF token to POST the list delete,
which is triggered by a click handler on the A element. The A element
is still needed for existing style reasons.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. In the staff interface, add a list
3. Go into that list (e.g. virtualshelves/shelves.pl?op=view&shelfnumber=X)
4. From the toolbar click the "Edit" dropdown
5. From the dropdown try either "Edit list" or "Delete list"
6. Note no CSRF error and operation completes as expected

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d3b7cf08949d5776b732f24cefcbe377260c281)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt