Review main Abandoned

79094[BUGFIX] Fix element check in initializeLocalizationStateSelector

Andreas Nedbal CR 0 V 0 Easy +8 −4 updated 11/10/26, 10:44

Commit message

The TCA `allowLanguageSynchronization` feature renders the so called
`LocalizationStateSelector`. Per default, it is set to
"Value of default language" and disables the input field. However, the
JavaScript code, which sets the disabled flag, requires the field to
have `data-formengine-input-name` set. This is now added to the two
simple select elements SelectSingleElement and SelectSingleBoxElement.

More complex form elements like Category, SelectCheckBox, etc. can't be
simply disabled by setting the disabled flag. They require special
handling, which is not part of this patch. They won't cause a console
error anymore, but are still editable. The backend processing will
however prevent changes to these values and reset them back to the
default value.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 4

Review log 1418

  1. Andreas Nedbal uploaded patch set 1 05/20/23, 00:03

  2. core-ci voted on patch set 1 V -1 05/20/23, 00:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41928

  3. Andreas Nedbal uploaded patch set 2 V -1 05/20/23, 00:27

  4. core-ci voted on patch set 2 V +1 05/20/23, 00:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41929

  5. Nikita Hovratov voted on patch set 2 V +1 CR +1 06/10/23, 21:48

  6. Nikita Hovratov commented on patch set 2 06/10/23, 21:55

    How to quickly reproduce: Add this to the config part of the doktype TCA definition: ``` 'behaviour' => [ 'allowLanguageSynchronization' => true, ], ``` The reason is, SelectSingleElement does not set `data-formengine-input-name` and thus the querySelector returns null.
  7. Nikita Hovratov commented on patch set 2 V 0 CR 0 06/10/23, 22:03

    Ah, actually the real bug is, that the LocalizationStateSelector does not work correctly on Select fields because of the reason stated above. This fix will make the console error disappear (which is good), but the Select field will not be disabled, even if it should.
  8. Nikita Hovratov uploaded patch set 3 V +1 06/10/23, 22:20

  9. core-ci voted on patch set 3 V +1 06/10/23, 22:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42352

  10. Nikita Hovratov uploaded patch set 4 V +1 06/10/23, 22:30

  11. Nikita Hovratov voted on patch set 4 V +1 CR +1 06/10/23, 22:33

  12. core-ci voted on patch set 4 V +1 06/10/23, 22:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42353

  13. Oli Bartsch commented on patch set 4 CR -1 06/12/23, 07:20

    form-engine.ts:742

    By adding "[data-formengine-input-name]" to the select types, this can now also be "HTMLSelectElement". Maybe we should therefore somehow change the selector name or at least the variable name here. Otherwise this will get a bit confusing. Alternatively, we just fix the JS error with the change in the next line and rethink how we can adapt this for all select fields in the long run. What do you think?
  14. Nikita Hovratov commented on patch set 4 V 0 CR 0 06/12/23, 07:37

    form-engine.ts:742 Reply Unresolved

    Only fixing the JS error is fine by me. I just thought we could fix the 2 easy cases with simple select fields immediately.
  15. Benni Mack updated the commit message in patch set 5 CR -1 V +1 10/18/24, 14:07

  16. Benni Mack commented on patch set 5 03/26/25, 14:01

    this has been around for quite some time now, will mark it as wip. Please update it or abandon it, if it is not relevant anymore.
  17. Benni Mack marked it work in progress 03/26/25, 14:01

  18. Benni Mack abandoned the change 11/10/26, 10:44

    this has been solved in the meantime, abandoning now