Project

General

Profile

Actions

Bug #77942

closed

Double click on save button creates two records.

Added by R3 H6 over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2016-09-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

Double click on save button creates two records.
TYPO3 6.2 and 7.6, on 8.3 not tried out.

Steps to reproduce:
  • 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

SplitButtons.js (2.92 KB) SplitButtons.js fixed script for v7+ Markus Timtner, 2016-11-17 21:55
jsfunc.tbe_editor.js (23.3 KB) jsfunc.tbe_editor.js fixed script for v6 Markus Timtner, 2016-11-17 23:23

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #77729: Save Button must be disabled until formengine form is fully loadedClosed2016-09-01

Actions
Related to TYPO3 Core - Bug #77944: Duplicate FE-Users on save-and-closeClosed2016-09-14

Actions
Related to TYPO3 Core - Bug #82355: SplitButton must reset preventExec flag if event was abortedClosedAndreas Kienast2017-09-07

Actions
Actions #1

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!

Actions #2

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.

Actions #3

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"

Actions #4

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.

Actions #5

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...

Actions #6

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.

Actions #7

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.

Actions #8

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...

Actions #9

Updated by Markus Timtner over 7 years ago

added fix touchup,
switched to variable handling.

Actions #10

Updated by Markus Timtner over 7 years ago

  • File deleted (SplitButtons.js)
Actions #11

Updated by Markus Timtner over 7 years ago

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.

Actions #12

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

Actions #13

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

Actions #14

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

Actions #15

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

Actions #16

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

Actions #17

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

Actions #18

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

Actions #19

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

Actions #20

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

Actions #21

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

Actions #22

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

Actions #23

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

Actions #24

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

Actions #25

Updated by Jan Helke about 7 years ago

  • Sprint Focus set to On Location Sprint
Actions #26

Updated by Markus Timtner about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 90 to 100
Actions #27

Updated by Gerrit Code Review about 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

Actions #28

Updated by Markus Timtner about 7 years ago

  • Status changed from Under Review to Resolved
Actions #29

Updated by Andreas Kienast over 6 years ago

  • Related to Bug #82355: SplitButton must reset preventExec flag if event was aborted added
Actions #30

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF