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:
parent
b3ec68b1ca
commit
1812097f40
|
|
@ -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."));
|
||||
|
|
|
|||
Loading…
Reference in New Issue