Summary: | Cancelling transfer on returns.pl is subject to a race condition | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Circulation | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Josef Moravec <josef.moravec> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, gmcharlt, josef.moravec, kyle.m.hall, lucas |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00,19.05.03
|
|
Circulation function: | |||
Attachments: |
Bug 23220: Prevent form submission before redirect
Bug 23220: Prevent form submission before redirect Bug 23220: Prevent form submission before redirect |
Description
Nick Clemens (kidclamp)
2019-06-26 12:47:39 UTC
The problem here is that the modal form is sill submitted on closing the modal, and if we aren't fast enough the redirect doesn't happen Created attachment 91017 [details] [review] 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 Created attachment 91021 [details] [review] 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> Created attachment 91034 [details] [review] 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> Nice work! Pushed to master for 19.11.00 Pushed to 19.05.x for 19.05.03 backported to 18.11.x for 18.11.09 |