Bug #80481
closedStory #69617: FormEngine bugs
FormEngine.Validation may access DOM too early
100%
Description
The initialization function of FormEngine.Validation is not registered as DOMready handler, but is called directly. This will cause problems on browsers with very fast JS evaluation, where the DOM is not yet ready.
Updated by Gerrit Code Review over 7 years ago
- Status changed from Accepted to Under Review
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/52180
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/52180
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/52180
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/52180
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/52208
Updated by Gerrit Code Review over 7 years ago
Patch set 2 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/52208
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/52180
Updated by Gerrit Code Review over 7 years ago
Patch set 3 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/52208
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/52180
Updated by Markus Klein over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 976934a36c8efde01c31ed38cafec7340562e6f4.
Updated by José Ricardo over 7 years ago
I'm still getting the problem on TYPO3 7.6.18. Anyone else?
Updated by Markus Klein over 7 years ago
@josé: Can you please describe what error you see? What behaviour do you experience? Any log messages in console?
Updated by José Ricardo over 7 years ago
No errors logged.
Here at my office we don't see the error (just got it once), but our costumer reports that often some news records (tx_news) are saved without title. They use Google Chrome + Windows (we recommended they to use Firefox by now to see if the error incidence goes down). The only thing logged in sys_log is this kind of message (no errors on any log):
Record '[Sem título]' (tx_news_domain_model_news:414408) was inserted on page 'Acervo de Notícias' (3) (msg#1.1.10)
'Sem título' means 'No title' in brazilian portuguese.
This is an inconsistent error, since we couldn't find at the moment any pattern involving it.
As the title is the only required field and the only field which is lost after saving, i'm starting believing it could be related.
This is happening on about 5~10% of the records inserted and to all users.
Updated by Markus Klein over 7 years ago
Yes I can confirm this issue as well. I saw that myself too, but this is not a bug anymore in TYPO3, it's a matter of waiting long enough to let form initialize.
If you do not wait long enough and start typing too fast, then this can happen. I currently have no clue if this is fixable without blocking the user's view (like hiding everything) until all stuff is initialized properly.
Updated by Riccardo De Contardi over 7 years ago
Updated by José Ricardo over 7 years ago
I confirm that it's a problem related to speed of user input against the form initialization.
On Chrome i've changed throttling preset to GPRS, so I cloud simulate a very slow connection. Before the form completed I was able to save the news record without selecting Categories (which are required in my project) and the title was lost.
Shouldn't TYPO3 block saving or typing anything on the forms before it's fully loaded? As there's no server-side validation of required fields, this behaviour could lead to errors on the system if those exceptions (like not having a category) are not handled.
Updated by Riccardo De Contardi over 7 years ago
Another possibly related: #77729
Updated by Christian Hillebrand over 7 years ago
just came in this trouble and my browser (google chrome) is telling me the following:
Uncaught TypeError: FormEngineValidation.registerReady is not a function index.php?route=%2Frecord%2Fedit&token=ab86687…&edit[tt_content][20…:155 at index.php?route=%2Frecord%2Fedit&token=ab86687…&edit[tt_content][20…:155 at Object.execCb (require-1604a50….js:1) at t.check (require-1604a50….js:1) at t.<anonymous> (require-1604a50….js:1) at require-1604a50….js:1 at require-1604a50….js:1 at each (require-1604a50….js:1) at t.emit (require-1604a50….js:1) at t.check (require-1604a50….js:1) at t.enable (require-1604a50….js:1)
and
Uncaught TypeError: FormEngine.setBrowserUrl is not a function index.php?route=%2Frecord%2Fedit&token=ab86687…&edit[tt_content][20…:149 at index.php?route=%2Frecord%2Fedit&token=ab86687…&edit[tt_content][20…:149 at Object.execCb (require-1604a50….js:1) at t.check (require-1604a50….js:1) at t.<anonymous> (require-1604a50….js:1) at require-1604a50….js:1 at require-1604a50….js:1 at each (require-1604a50….js:1) at t.emit (require-1604a50….js:1) at t.check (require-1604a50….js:1) at t.<anonymous> (require-1604a50….js:1)
when i check the script at this position, there is:
/*RequireJS-Module-TYPO3/CMS/Backend/FormEngined935ebd2ae27fe1f92ebe73abca953afd001513e*/
require(["TYPO3/CMS/Backend/FormEngine"], function(FormEngine) {
FormEngine.setBrowserUrl('\/typo3\/index.php?route=%2Fwizard%2Frecord%2Fbrowse\u0026token=2836d0b1a12176fd49ebe29df35a23dc2679be42');
});
/*RequireJS-Module-TYPO3/CMS/Backend/FormEngineValidationdfe861477e946addc2b2ba604b52bdb6630146a5*/
require(["TYPO3/CMS/Backend/FormEngineValidation"], function(FormEngineValidation) {
FormEngineValidation.setUsMode(0);
FormEngineValidation.registerReady();
});
While i am on the URL: https://..../typo3/index.php?route=%2Fmain&token=101e14d3018533802a55e2129cc0bc855c62e67e
does this maybe matter?
on firefox i get allmost the same ... just another set of token
Updated by Markus Klein over 7 years ago
@Christian: Can you please flush your browser's cache! There is actually no other cause for your errors, because the missing functions have been added and are new. Since your browser does not know them, it is clear it uses old files.
Updated by Markus Klein over 7 years ago
- Related to Bug #80672: Saving problems in Chrome 57+ added
Updated by Markus Klein over 7 years ago
- Related to Bug #80632: still issues with missing input in BE added
Updated by Christian Hillebrand over 7 years ago
i even installed an update in chrome ... so i restarted chrome multiple times ... it did not changed anything ... i wasn't able to see any form contents
now ... 30 minutes later it seems to work again ... without doing anything further :P
Updated by Markus Klein over 7 years ago
Updating Chrome does not flush its caches ;-)
Updated by Christian Hillebrand over 7 years ago
i did not flush the cache manually at any time - but its working now for any reason ;)
and i used the developer tools with "disable cache" enabled
Updated by Oliver Hader over 7 years ago
- Related to Bug #81520: form validation in backend not working onload added