Bug 23220: Prevent form submission before redirect

To test:
 1 - Check in an item to generate a transfer (form another library, no floating)
 2 - Check it in again, click 'Cancel transfer'
 3 - It may or may not work
 4 - To highlight the issue edit return.tt to add the delay line as below:
	$('.cancel-transfer').on("click",function(e){
		delay(5000);
		window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber | html %]&canceltransfer=1'
	});
 5 - Check in the item repeatedly, click 'Cancel transfer'
 6 - View the item in the staff or opac and verify it remains in transit
 7 - Undo changes above, apply patch
 8 - Test 'Cancel transfer', note it works
 9 - Add the delay back in, confirm it still works

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-06-26 12:49:14 +00:00 committed by Martin Renvoize
parent 466f99e442
commit 4dcf416dc9
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -962,6 +962,7 @@
});
$('.cancel-transfer').on("click",function(e){
e.preventDefault();
window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber | html %]&amp;canceltransfer=1'
});