Bug #81520

form validation in backend not working onload

Added by DMK E-BUSINESS GmbH about 1 year ago. Updated 12 months ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Backend User Interface
Target version:
Start date:
2017-06-08
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
7.1
Tags:
eval required TCA FormEngine TCEFORMS
Complexity:
hard
Is Regression:
Yes
Sprint Focus:

Description

When a form is loaded (e.g. when adding a new page) required fields are not evaluated on load of the form. As soon as I change a field all required fields are evaluated and marked when empty.
This is a problem as the form can be saved successfully as long as no inputs are done even though fields are required.

I experience this bug since TYPO3 7.6.17. In TYPO3 7.6.16 everything works fine.

I think this commit is the cause for this bug: https://github.com/TYPO3/TYPO3.CMS/commit/e6b3d3c3ddfbff752426e8002914b14ef2e5893c

related issue: https://forge.typo3.org/issues/80481


Related issues

Related to TYPO3 Core - Bug #80481: FormEngine.Validation may access DOM too early Resolved 2017-03-27

Associated revisions

Revision 2ed9d0b7 (diff)
Added by Michael Stucki 12 months ago

[BUGFIX] Validate FormEngine fields on load

Make sure the validation of FormEngine fields is triggered on load.
This bug does not occur in newer versions.

Releases: 7.6
Resolves: #81520
Change-Id: Iaeff5c82350fd529e4ad85af1477b193146ae0f0
Reviewed-on: https://review.typo3.org/53328
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Andreas Fernandez <>
Tested-by: TYPO3com <>

History

#1 Updated by Georg Ringer about 1 year ago

  • Status changed from New to Needs Feedback

can you test latest version?

#2 Updated by DMK E-BUSINESS GmbH about 1 year ago

The problem still exists. I tried it with commit 20a9592cacb81433be5c5dca2f077bdb00b5ace0. After loading the form in the backend there seems to be some Ajax action but the fields still get not marked as required as long as no field was changed.

#3 Updated by Oliver Hader about 1 year ago

  • Related to Bug #80481: FormEngine.Validation may access DOM too early added

#4 Updated by Markus Klein about 1 year ago

  • Target version set to Candidate for patchlevel
  • Is Regression set to Yes

#5 Updated by Markus Klein about 1 year ago

  • Status changed from Needs Feedback to New

#6 Updated by Markus Klein about 1 year ago

  • Status changed from New to Needs Feedback

I tried it with latest 7.6.19-dev and it seems to work there.

#7 Updated by DMK E-BUSINESS GmbH 12 months ago

I just tried it with the new 7.6.19 and the problem still exists for me.

#8 Updated by Markus Klein 12 months ago

  • Status changed from Needs Feedback to New
  • Target version deleted (Candidate for patchlevel)
  • Is Regression deleted (Yes)

#9 Updated by Frank Naegler 12 months ago

  • Status changed from New to Needs Feedback

Hi,
we have problems to reproduce this behavior, please provide some more information:

1) Which browser and version?
2) Which operation system and version?
3) How fast is your internet connection, please let run a speedtest and show us the connection information

#10 Updated by Hannes Bochmann 12 months ago

1) Firefox 54.0, Chrome 59.0.3071.109
2) Debian 8.7 inside docker container / native Ubuntu 16.04
3) Does not matter. The sites runs locally inside a docker container. If I run it on my machine directly through an Apache webserver I get the same results. As soon as I downgrade to TYPO3 7.6.16 everything works again.

#11 Updated by Markus Klein 12 months ago

  • Status changed from Needs Feedback to Accepted
  • Assignee set to Markus Klein
  • Target version set to next-patchlevel
  • Complexity set to hard

I do have a local project now, where I can reproduce the issue.

Latest 7.6 source, latest Chrome. No messages in the console.

#12 Updated by Michael Stucki 12 months ago

  • File 81520-BUGFIX-Validate-FormEngine-fields-on-load.patch added

The attached patch will solve this problem on TYPO3 7.6.
It looks like the validate() function of the FormEngineValidation object is not called on start.
I did not try this in an empty installation yet, but for me it looks obvious that this is currently broken.

How to reproduce:
1. Create a new page
2. Save immediately without touching any input fields
3. The page is saved although it has required fields (e.g. page title) empty

Does this problem also happen in version 8?

#13 Updated by Gerrit Code Review 12 months ago

  • Status changed from Accepted 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/53328

#14 Updated by Michael Stucki 12 months ago

  • File deleted (81520-BUGFIX-Validate-FormEngine-fields-on-load.patch)

#15 Updated by Gerrit Code Review 12 months 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/53328

#16 Updated by Gerrit Code Review 12 months 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/53328

#17 Updated by Michael Stucki 12 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#18 Updated by Michael Stucki 12 months ago

  • Is Regression set to Yes

Also available in: Atom PDF