Is there any way to make it so that you can't accidentally double click on the submit/pay button when dealing with fines? Sometimes it happens and right now when you try to reverse payments it gets way ugly (another bug report coming) but really it would make the most sense to try and prevent double clicking if at all possible.
kyle has a bit of code for this, I'll try to find it and whack it in on the fines page.
Actually I need to know exactly what I am replicating so I can verify if the fix works - can you give me some concrete steps to follow so I can 1. see the problem and 2. make sure the fix works as we expect? Thanks! Liz
Created attachment 14303 [details] [review] Bug 8054 - double clicking can cause duplicate payments/fines Uses preventDoubleForSubmit() to prevent double form submissions in the fines module. To test: Create a manual invoice/fine Create some manual fines, click save like mad - you should get only one fine (without, you will get several if you click madly enough) Click Pay fines Pay some fines, clicking save like mad on each. You should only get one payment. (without, you will get several payments) Create a manual credit Create a credit, click save like mad. You should only get one credit. (without you will get several if you click madly enough)
I was testing and it did prevent me from being able to submit 100 times :) but when I clicked the 'Pay' button next to one line it instead acted like the 'Pay Amount' button and showed me all that was due.
are you sure that behavior doesn't manifest on master already? Because I didn't change anything that has to do with what you are describing.
I just tested that - it behaves correctly for me.
were you testing this on a patron where you had multiple fines created with the mad clicking? I wonder if the mad clicking duplicate fines are why you see this. (do note I haven't tested that theory)
I cannot, under any condition I can think of, replicate your problem with this patch (or on master, either).
Created attachment 14432 [details] [review] Bug 8054 - double clicking can cause duplicate payments/fines Uses preventDoubleForSubmit() to prevent double form submissions in the fines module. To test: Create a manual invoice/fine Create some manual fines, click save like mad - you should get only one fine (without, you will get several if you click madly enough) Click Pay fines Pay some fines, clicking save like mad on each. You should only get one payment. (without, you will get several payments) Create a manual credit Create a credit, click save like mad. You should only get one credit. (without you will get several if you click madly enough) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 15971 [details] [review] Bug 8054 - double clicking can cause duplicate payments/fines Uses preventDoubleForSubmit() to prevent double form submissions in the fines module. To test: Create a manual invoice/fine Create some manual fines, click save like mad - you should get only one fine (without, you will get several if you click madly enough) Click Pay fines Pay some fines, clicking save like mad on each. You should only get one payment. (without, you will get several payments) Create a manual credit Create a credit, click save like mad. You should only get one credit. (without you will get several if you click madly enough) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Seems to work fine although I may not be that good in madly clicking..
QA Comment: Small changes. Using existing jquery to prevent double submission. Improving usability (foolproof..) Passed QA
Better in midair collisions :)
This patch has been pushed to master.
Pushed to 3.8.x and 3.10.x will be in 3.8.11 and 3.10.4
Pushed to 3.10.x and 3.8.x will be in 3.10.4 and 3.8.11