92923[FEATURE] Enable condition-based configuration of fields as required
Commit message
Review
-
Code review CR 0
-
Verified V 0
- core-ci +1 CI
Issues 2
Files 9
- typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateDisplayConditions.php2+9 −776
- typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateRequiredConditions.php8new+156 −0
- typo3/sysext/backend/Classes/Form/Service/TcaConditionService.php6new+792 −0
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/Fixtures/EvaluateRequiredConditionsTestClass.phpnew+83 −0
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php+37 −36
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateRequiredConditionsTest.phpnew+3827 −0
- typo3/sysext/core/Configuration/TCA/pages.php+2 −0
- typo3/sysext/core/Configuration/DefaultConfiguration.php+10 −0
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-108937-EnableConfiguringFieldAsRequiredDependendingOnOtherFieldsInTCA.rst4new+62 −0
Review log 2533
Show 68 earlier messages
-
Bastien Lutz uploaded patch set 1 02/20/26, 13:24
-
core-ci voted on patch set 1 V -1 02/20/26, 14:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96348
-
Bastien Lutz uploaded patch set 2
V -102/20/26, 14:57 -
core-ci voted on patch set 2 V +1 02/20/26, 15:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96364
-
Andreas Nedbal voted on patch set 2 CR +1 V +1 02/23/26, 11:17
-
Oli Bartsch commented on patch set 2 02/23/26, 14:00
Could you please have a look at the commit message. it seems that there are a couple of words missing, as well as line length limit. -
Bastien Lutz updated the commit message in patch set 3
CR +1V +102/23/26, 14:45 -
Bastien Lutz commented on patch set 3 02/23/26, 14:46
Reply
Done
-
core-ci voted on patch set 3 V +1 02/23/26, 15:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96587
-
Oli Bartsch commented on patch set 3 V -1 02/23/26, 17:55
This now prevents to switch form the default "0" mode to any other mode. After confirmation of the "needs reload" modal, the previous state is restored.EvaluateRequiredConditions.php:65Based on the comment `not marked`, shouldn't this be `!$conditionResult`, or is the comment wrong?Feature-108937-EnableConfiguringFieldAsRequiredDependendingOnOtherFieldsInTCA.rst:14This sounds really generic. Please let's avoid to start this way for features. Just tell what is introduced, and then a why can be added. Otherwise one might argue that this is not a feature but a bugfix.Feature-108937-EnableConfiguringFieldAsRequiredDependendingOnOtherFieldsInTCA.rst:25Still we might mention some or at least add a link to the documentation. -
Benni Mack commented on patch set 3 02/24/26, 07:54
I recently built this a different way than the ugly displayCond syntax (not for required though) ... I used symfony expression builder for this which is really really easy to use (and more wide-spread): $expressionLanguage = new ExpressionLanguage(); if ($expressionLanguage->evaluate($condition, $recordDataOrData)) { then you can do requiredIf => "field('pid') > 123" etc. in a more understandable way -
Bastien Lutz commented on patch set 3 02/24/26, 09:12
Reply
this is also a nice approach. But i thought, as there already is a condition metric in the TCA we should just stick to it. Might make life easier to have one syntax for the whole TCA topic. -
Oli Bartsch commented on patch set 3 02/24/26, 09:22
Reply
What about using the current approach for v14 and migrate the now centralized `TcaConditionService` functionality to expression language in v15? -
Bastien Lutz commented on patch set 3 02/24/26, 14:59
Reply
after some debugging this was due to a regression through: https://review.typo3.org/c/Packages/TYPO3.CMS/+/92910 but will be fixed with https://review.typo3.org/c/Packages/TYPO3.CMS/+/92983 i'll add this as a relation chain. -
Bastien Lutz uploaded patch set 4
V +102/24/26, 15:54 -
Bastien Lutz uploaded patch set 5 02/24/26, 16:03
-
Bastien Lutz commented on patch set 4 02/24/26, 16:03
EvaluateRequiredConditions.php:65ReplyThis was due to a copy & paste error from EvaluateDisplayConditions it should always be added if the type is flex.Feature-108937-EnableConfiguringFieldAsRequiredDependendingOnOtherFieldsInTCA.rst:14ReplyDoneFeature-108937-EnableConfiguringFieldAsRequiredDependendingOnOtherFieldsInTCA.rst:25ReplyDone -
core-ci voted on patch set 4 V +1 02/24/26, 16:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96763
-
core-ci voted on patch set 5 V +1 02/24/26, 16:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96764
-
Simon Schaufelberger commented on patch set 5 02/24/26, 17:54
EvaluateDisplayConditions.php:30can be readonlyEvaluateRequiredConditions.php:30can be readonlyEvaluateRequiredConditions.php:40this annotation is not helpfulEvaluateRequiredConditions.php:86i really don't like deep nesting. can we have a negated condition here and use continue?TcaConditionService.php:222use return here directly.TcaConditionService.php:656use return here directly and everywhere below -
Bastien Lutz rebased onto patch set 6
V +102/25/26, 09:10 -
core-ci voted on patch set 6 V +1 02/25/26, 09:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96804
-
Bastien Lutz uploaded patch set 7
V +102/25/26, 09:34 -
Bastien Lutz commented on patch set 7 02/25/26, 09:35
Thanks for the review. Done.EvaluateDisplayConditions.php:30ReplyDoneEvaluateRequiredConditions.php:30ReplyDoneEvaluateRequiredConditions.php:40ReplyDoneEvaluateRequiredConditions.php:86ReplyDoneTcaConditionService.php:222ReplyDoneTcaConditionService.php:656ReplyDone -
core-ci voted on patch set 7 V +1 02/25/26, 10:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96805
-
Simon Schaufelberger commented on patch set 7 CR +1 02/25/26, 10:30
Much better! -
Simon Schaufelberger commented on patch set 7 CR 0 02/25/26, 10:35
TcaConditionService.php:137this one could be negated as well -
Benni Mack commented on patch set 7 02/25/26, 11:31
Reply
We still haven't defined then what to do with the places in DataHandler then? We could then rename the property to "displayRequiredCond" :) - "requiredCond" (= and evaluation in persistence makes it much harder). In case we don't have any more use-cases --- right now --- we could also stick to a custom render Type for this single-use case now. -
Bastien Lutz commented on patch set 7 02/25/26, 13:38
Reply Unresolved
This patch is currently working without touching the DataHandler. Am i missing something? Should something be adjusted in the DataHandler? If so we might switch to symfony expression language if not i don't think this is necessary. -
Bastien Lutz uploaded patch set 8
V +102/25/26, 13:44 -
core-ci voted on patch set 8 V +1 02/25/26, 13:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96824
-
Bastien Lutz commented on patch set 8 02/25/26, 13:59
TcaConditionService.php:137ReplyDone -
Bastien Lutz abandoned the change 03/16/26, 13:04
It is unclear how this is treated in the Datahandler. For instance there only is one usecase. This is done in: 93021: [TASK] Mark shortcut as required if shortcut_mode=0 | https://review.typo3.org/c/Packages/TYPO3.CMS/+/93021