Bug #77942
closedDouble click on save button creates two records.
100%
Description
Double click on save button creates two records.
TYPO3 6.2 and 7.6, on 8.3 not tried out.
- Go to list module
- Click new record "fe_user"
- Fill out the form
- Double click the save button
You see the result immediately because the username has now an additional zero.
Solution:
Disable Save-Buttons after click, or remove click listener.
Similar Issue:
https://forge.typo3.org/issues/77729
Files
Updated by Riccardo De Contardi over 7 years ago
- Status changed from New to Needs Feedback
Hi can you tell us what browser are you using?
I'm asking because I think that this one is a duplicate of #77469; can you confirm?
Thank you!
Updated by R3 H6 over 7 years ago
This is not a duplicate.
I use Chrome (Version 53.0.2785.143 (64-bit)), when I double-click on the save button, two records will be created.
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Needs Feedback to New
Yes, I can confirm it with Chrome on both 7.6.11 (Windows) and 8.5-dev (MAC)
Moreover, I obtain a javascript alert message "Message too long for RSA"
Updated by Mathias Brodala over 7 years ago
Riccardo De Contardi wrote:
Yes, I can confirm it with Chrome on both 7.6.11 (Windows) and 8.5-dev (MAC)
Moreover, I obtain a javascript alert message "Message too long for RSA"
I can confirm this behavior on the latest v8 master.
Updated by Markus Timtner over 7 years ago
- Category changed from FormEngine aka TCEforms to Backend User Interface
I noticed this behavior today, too.
I managed to reproduce it in Chrome, but not in firefox or edge. (win)
This bug isn't restricted to fe_users records only, but to ALL save&close actions.
A fix would be to set this input button as "disabled" after the first click.
I'm still struggling to find the corresponding JS for that...
Updated by Markus Klein over 7 years ago
As far as I know the Save buttons already have some sort of "double submission prevention" in the form of "button is disabled after click".
Albeit I do not consider this form of prevention as sufficient or even desirable, I guess Chrome changed around the event handling and the double click is attached to the even queue before the click handler can disable the button.
This is just a wild guess, but maybe I hit the right direction.
Updated by Markus Timtner over 7 years ago
- File SplitButtons.js added
Just had a look into the corresponding script: ( typo3/sysext/backend/Resources/Public/JavaScript/SplitButtons.js ) (many thanks to Matthias Schreiber for pointing that out so fast)
Yes, there is a disabled handling in there, but that is called within the form.on(submit) after a preSubmit callback loop - each another function call.
Apprently, the chrome javascript engine is so fast now, that the on(click)-Event is called twice when you click fast enough.
The solution here is to to gate the execution by adding a class, so the code will only execute once.
Unfortunately, I have no idea yet on how to submit this fix.
Oh, and I have to figure out the right script for v6.
Updated by Markus Timtner over 7 years ago
jsut had a review of the script,
it might be better to handle this variable-only instead of DOM-manipulating...
Updated by Markus Timtner over 7 years ago
- File SplitButtons.js SplitButtons.js added
- Assignee set to Mark Houben
- % Done changed from 0 to 50
added fix touchup,
switched to variable handling.
Updated by Markus Timtner over 7 years ago
- File jsfunc.tbe_editor.js jsfunc.tbe_editor.js added
- Assignee deleted (
Mark Houben) - % Done changed from 50 to 90
ok, the issue for v6 is now fixed, too!
The correspanding script in v6 is: typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js
Here, there mechanics are similiar.
Apart from that, there is already a window.setTimeout call present in the function submitForm - I raised the timeout a little, resulting in now correct behaviour.
Now some testing, feedback and at last, merging is needed.
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50705
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50706
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50707
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50721
Updated by Gerrit Code Review over 7 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Gerrit Code Review over 7 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50720
Updated by Markus Timtner over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 90 to 100
Applied in changeset 588a5c52ad7f7fad513cb07f9688af0e193bfdaa.
Updated by Gerrit Code Review over 7 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50857
Updated by Markus Timtner over 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset 4561d4a3277e5af75cea66ab52c69de1ebc06415.
Updated by Andreas Kienast over 6 years ago
- Related to Bug #82355: SplitButton must reset preventExec flag if event was aborted added