Bug 36946: Fix cud- error when processing offline circulations

This patch fixes a CSRF token error when processing offline
circulations. The form needed both the token parameter and to be sent as
POST.

To test, apply the patch and go to Circulation.

- Go to Upload offline circulation file (.koc)
- Upload a .koc file, add to offline circulation queue.
- View pending offline circulation actions.
- Check one or more transactions and click "Process" at the bottom of
  the page.
  - The process should complete without any JS errors, and the
    checkboxes should be replaced with the text "Success."
- Perform the same test with the "Delete" button.

Sponsored-By: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2024-05-23 13:13:06 +00:00 committed by Katrin Fischer
parent b3ec68b1ca
commit 1812097f40
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 6 additions and 1 deletions

View File

@ -137,9 +137,14 @@
var cb = $(this);
$.ajax({
url: "process.pl",
data: { 'op': 'cud-' + op, 'operationid': this.value },
data: {
'op': 'cud-' + op,
'operationid': this.value,
'csrf_token': $('meta[name="csrf-token"]').attr('content')
},
async: false,
dataType: "text",
type: "POST",
success: function(data) {
if( data == "Added." ){
cb.replaceWith(_("Added."));