Review main Merged

83837[BUGFIX] Avoid "Save changes and view" in FormEngine if form is invalid

Andreas Kienast CR +2 V +2 Normal +55 −26 updated 04/07/25, 13:20

Commit message

The implementation of the "Save changes and view" modal triggered in
FormEngine via the "View" button is prone to data inconsistency as it
may save the form and bypass the FormEngine validation.

The "View" modal now checks whether the current FormEngine state is
invalid and therefore won't render the "Save changes and view" button.

Please note: the bug cannot get triggered in TYPO3 v13+ "by accident"
due to underlying refactorings in the FormEngine done lately. However,
for UX reasons the same changes are implemented.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Garvin Hicking +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Garvin Hicking +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 5

Review log 2233

Show 48 earlier messages
  1. Andreas Kienast uploaded patch set 1 04/16/24, 14:36

  2. core-ci voted on patch set 1 V +1 04/16/24, 14:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56090

  3. Andreas Kienast uploaded patch set 2 V +1 09/10/24, 13:00

  4. core-ci voted on patch set 2 V -1 09/10/24, 13:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65247

  5. core-ci voted on patch set 2 V +1 09/10/24, 13:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65247

  6. Andreas Kienast rebased onto patch set 3 V +1 09/25/24, 13:34

  7. core-ci voted on patch set 3 V +1 09/25/24, 13:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66587

  8. Andreas Kienast abandoned the change 10/14/24, 19:19

  1. Andreas Kienast restored the change 11/04/24, 07:49

  2. Andreas Kienast uploaded patch set 4 V +1 11/04/24, 07:53

  3. core-ci voted on patch set 4 V +1 11/04/24, 08:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69016

  4. Andreas Kienast uploaded patch set 5 V +1 11/20/24, 15:56

  5. core-ci voted on patch set 5 V +1 11/20/24, 16:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69811

  6. Garvin Hicking commented on patch set 5 CR +1 V +1 11/21/24, 08:45

    Tested this in v14 main and v12 and seems to do what's advertised. :-)
  7. Andreas Kienast uploaded patch set 6 CR +1 V +1 11/21/24, 09:09

  8. core-ci voted on patch set 6 V +1 11/21/24, 09:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69899

  9. Andreas Kienast uploaded patch set 7 V +1 11/21/24, 10:38

  10. core-ci voted on patch set 7 V +1 11/21/24, 10:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69916

  11. Andreas Kienast uploaded patch set 8 V +1 03/25/25, 09:00

  12. core-ci voted on patch set 8 V +1 03/25/25, 09:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76215

  13. Garvin Hicking voted on patch set 8 CR +1 V +1 03/25/25, 09:11

  14. Andreas Kienast uploaded patch set 9 CR +1 V +1 04/01/25, 11:24

  15. Garvin Hicking voted on patch set 9 CR +1 V +1 04/01/25, 11:28

  16. core-ci voted on patch set 9 V +1 04/01/25, 11:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76773

  17. Stefan Bürk commented on patch set 9 CR -1 04/03/25, 08:17

    Sorry to put a -1 on on this. The issue is not fully solved. The changed modal detects the issues in the form and removes the "save and view" button with a additional text, but leaves the "view without changes" button available. That works for content elements which has been persisted before, but for a new element which should be added the "view without changes" opens a new tab and stucks on a empty about page. PageLayoutModule -> add content element -> menu/categorized content -> click the preview button without any changes, mainly leaving required category select untouched -> modal opens with only "view ithout changes" + cancle -> click view => get stucked on about page in new tab.
  18. Stefan Bürk commented on patch set 9 04/03/25, 08:18

    Reply

    tested on current main + cherrpicket latest patchlevel...
  19. Andreas Kienast uploaded patch set 10 CR +1 V +1 04/04/25, 09:25

  20. Andreas Kienast commented on patch set 10 04/04/25, 09:31

    Reply

    This is an issue caused by https://review.typo3.org/c/Packages/TYPO3.CMS/+/75164. I don't understand why this was changed to `currentTarget` at all.
  21. core-ci voted on patch set 10 V +1 04/04/25, 09:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76991

  22. Stefan Bürk commented on patch set 10 CR +1 V +1 04/04/25, 13:36

    Reply

    Thanks for taking care of this too. Tested around again, and the original approach with the addional fix works now. Tried to break it, but was not successfull anymore.
  23. Garvin Hicking voted on patch set 10 CR +1 V +1 04/04/25, 14:06

  24. Andreas Kienast voted on patch set 10 CR +2 V +2 04/07/25, 13:01

  25. Andreas Kienast merged patch set 11 04/07/25, 13:20