Bug 37039: Update discharge request with CSRF token
authorOwen Leonard <oleonard@myacpl.org>
Wed, 5 Jun 2024 18:06:04 +0000 (18:06 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 10 Jun 2024 11:01:06 +0000 (12:01 +0100)
commit67cedc9955f50c4d51b2e9a1f68ab0cac8e9a44f
treee62437480e5582433ba8b0c80fbec4026e1a436f
parentfff166679b43db5baab8ee9112f77164f4d42c87
Bug 37039: Update discharge request with CSRF token

The OPAC discharge page used a link with a GET parameter, but the script
expects a POST request. This patch converts the link to a form with CSRF
token included.

To test, apply the patch and enable the useDischarge system preference
if necessary.

- Log in to the OPAC as a user with no checkouts or outstanding fees.
- Click the "Ask for discharge" tab in the sidebar of the user summary
  page.
- Click the "Ask for a discharge" button.
- You should be redirected to a page that says "Your discharge request
  has been sent."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt