81612[!!!][TASK] Offload null value checkbox handling from JavaScript
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 11
- Build/Sources/TypeScript/backend/form-engine.ts+13 −36
- typo3/sysext/backend/Classes/Form/Element/ColorElement.php3+12 −3
- typo3/sysext/backend/Classes/Form/Element/DatetimeElement.php+13 −3
- typo3/sysext/backend/Classes/Form/Element/EmailElement.php+12 −3
- typo3/sysext/backend/Classes/Form/Element/InputTextElement.php+12 −3
- typo3/sysext/backend/Classes/Form/Element/LinkElement.php+13 −3
- typo3/sysext/backend/Classes/Form/Element/NumberElement.php+12 −3
- typo3/sysext/backend/Classes/Form/Element/PasswordElement.php+13 −6
- typo3/sysext/backend/Classes/Form/Element/TextElement.php+13 −3
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine.js+1 −1
- typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102287-OffloadNullValueCheckboxStateRenderingFromJavaScript.rst3new+107 −0
Review log 1825
-
Andreas Kienast uploaded patch set 1 10/30/23, 10:44
-
core-ci voted on patch set 1 V +1 10/30/23, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48350
-
Andreas Kienast uploaded patch set 2
V +110/30/23, 11:46 -
core-ci voted on patch set 2 V +1 10/30/23, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48353
-
Andreas Kienast uploaded patch set 3
V +110/30/23, 13:45 -
core-ci voted on patch set 3 V +1 10/30/23, 13:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48356
-
Garvin Hicking commented on patch set 3 10/30/23, 13:57
-
Andreas Kienast commented on patch set 3 10/30/23, 14:00
Breaking-102287-OffloadNullValueCheckboxStateRenderingFromJavaScript.rst:39ReplyI also thought about that, let's see if I can work this out somehow. -
Andreas Kienast uploaded patch set 4
V +110/30/23, 14:07 -
Garvin Hicking commented on patch set 4 10/30/23, 14:08
Breaking-102287-OffloadNullValueCheckboxStateRenderingFromJavaScript.rst:39ReplyWorks for me, that's very helpful. -
Andreas Kienast uploaded patch set 5 10/30/23, 14:09
-
core-ci voted on patch set 4 V +1 10/30/23, 14:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48357
-
core-ci voted on patch set 5 V +1 10/30/23, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48358
-
Garvin Hicking commented on patch set 5 10/30/23, 14:35
ColorElement.php:238Check above was made with strict (=== '') comparison, maybe use this here too for uniformity? (also applies to all other RenderTypes) -
Andreas Kienast commented on patch set 5 10/30/23, 14:38
ColorElement.php:238ReplyFair enough -
Andreas Kienast uploaded patch set 6
V +110/30/23, 14:45 -
Andreas Kienast commented on patch set 6 10/30/23, 14:45
ColorElement.php:238ReplyDone -
core-ci voted on patch set 6 V +1 10/30/23, 14:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48361
-
Andreas Kienast uploaded patch set 7
V +110/31/23, 05:50 -
core-ci voted on patch set 7 V +1 10/31/23, 05:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48378
-
Garvin Hicking commented on patch set 7 10/31/23, 09:12
Tested this some more. Works as advertised... however: May I suggest adding a block like this to the section "Migration": ``` You can find custom extensions registering custom FormElements by searching for GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'] in ext_localconf.php. While a custom FormElement is not adapted to the new syntax, the input area for a saved NULL value will NOT be greyed out and disabled. That leads to any input getting entered in this state will not be persisted, because the corresponding checkbox would be unchecked. By checking the `Set value` checkbox in this unadapted state, no values could be entered. Thus: without adaptation, the nullable checkbox logic would be reversed. ``` I must admit that having this logic applied to unadapted form fields is a bit dangerous due to the logic reversal and may lead to data loss when saving. So I wonder if we could "do more" for integrators to catch this. How about the adapted core fields add a specific CSS class like `t3js-formengine-nullable-support`. Then, the JS would only properly operate on fields having said class. And if the JS would toggle the state in unadapted fields, we could present an alert/warning like "Custom FormElement is nullable, but has not been adapted to proper syntax". This wouldn't be a real "migration" then, since it only depends on a CSS class that would not need to be removed anytime, and would provide stability? Especially because the Scanner isn't able to detect custom FormElement nullable usage and warn about it...? -
Andreas Kienast commented on patch set 7 CR -2 10/31/23, 09:59
Reply
Data loss is something we must avoid under any circumstance. I'll think about the whole approach, maybe I'll come up with something better. -
Simon Schaufelberger commented on patch set 7 01/25/24, 14:26
Reply
@a.fernandez@scripting-base.de Will this make it for v13? -
Andreas Kienast commented on patch set 7 01/26/24, 07:47
Reply
Definitely not. v13.0 release is next Tuesday and FormEngine would need more refactoring in that regard. Abandoning for now. -
Andreas Kienast abandoned the change 01/26/24, 07:47
Breaking-102287-OffloadNullValueCheckboxStateRenderingFromJavaScript.rst:39