90144[BUGFIX] Allow form element identifier in email finisher overrides
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Christian Kuhn +1
-
Verified V +2 Done
- Garvin Hicking +2
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 4
Review log 3447
Show 1622 earlier messages
-
Josua Vogel uploaded patch set 1 07/24/25, 14:21
-
core-ci voted on patch set 1 V -1 07/24/25, 14:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82249
-
Josua Vogel uploaded patch set 2
V -107/24/25, 14:39 -
core-ci voted on patch set 2 V +1 07/24/25, 14:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82252
-
Garvin Hicking updated the commit message in patch set 3
V +107/28/25, 09:12 -
Garvin Hicking commented on patch set 3 07/28/25, 09:12
I didn't find out what "SW" is referring to, maybe we can find a more speaking name for this?DataHandlerHook.php:54I think we can do this without a temporary variable and legibility doesn't suffer too much? ```suggestion if (!GeneralUtility::validEmail($res['value']) && !preg_match('/\{.+\}/', $res['value'])) { ``` -
core-ci voted on patch set 3 V +1 07/28/25, 09:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82420
-
Josua Vogel commented on patch set 3 07/28/25, 09:21
Reply
Yes, I wanted to name it after the method in which the hook was called. Perhaps SW stands for switch (because different methods are called for the TCA types). I will adjust it.DataHandlerHook.php:54ReplyI like short conditions from a clean code perspective and for readability. Do you see any disadvantage to using a temporary variable? -
Garvin Hicking commented on patch set 3 07/28/25, 09:55
Notes from our private chat: - Will be applied to all "type:email" inputs of the YAML - Also apply to `settings.finishers.EmailToSender.senderAddress`? - Hook needs to evaluate `$additionalData['flexFormPath']` in case `$field` is emptyDataHandlerHook.php:54ReplyI wouldn't press on it, I don't think we have a hard "rule" on this in the TYPO3 core. If you feel more comfortable with it, it's your contribution, I'm good with it :-) -
Josua Vogel uploaded patch set 4
V +107/28/25, 14:18 -
Josua Vogel updated the commit message in patch set 5 07/28/25, 14:18
-
core-ci voted on patch set 4 V +1 07/28/25, 14:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82426
-
core-ci voted on patch set 5 V +1 07/28/25, 14:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82427
-
Garvin Hicking updated the commit message in patch set 6
V +107/28/25, 14:41 -
Garvin Hicking commented on patch set 6 CR +1 V +1 07/28/25, 14:42
Reply
DoneThanks, this is a nice tradeoff to me! :-)Reply
works for me :) -
core-ci voted on patch set 6 V +1 07/28/25, 14:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82429
-
Oli Bartsch commented on patch set 6 V -1 07/28/25, 14:55
Hi thanks for your patch. I unfortunately think that we can not move on with the current approach. Please have a look at my comments. I still suggest to use dedicated new @internal option on type "input" to add both client and server-side validation.DataHandler.php:1322A new hook / event always needs documentation. However, I don't think that we should introduce new hooks at this place at all.DataHandlerHook.php:30I think we need some client side validation as well.DataHandlerHook.php:47`renderType` are for display purposes only and are not to be evaluated by the Datahandler. -
Josua Vogel commented on patch set 6 07/28/25, 15:07
Reply
Do you mean adding a custom type that´s only internal?DataHandler.php:1322ReplyUnderstand this. This hook would give the ability to have a real serverside validation and prevent saving a record. I looked at SourceHost (inside EXT:redirects) - the serverside evaluation just clears the value, but the record is saved anyways. IMO that behaviour isn´t great and there is no good alternative. This hook could be used by custom fields like SourceHost to prevent the saving of an invalid record without manipulation magicDataHandlerHook.php:30Replytotally agree -
Josua Vogel commented on patch set 6 07/28/25, 15:12
DataHandlerHook.php:47ReplyOkay. Theoretically, you could render the field differently and display a dropdown for the FormElementIdentifier in the long term, as in FormEditor. -
Garvin Hicking commented on patch set 6 CR 0 V 0 07/28/25, 15:29
Thanks Oli for the additional thoughts. I hope we can find a way to solve this. -
Oli Bartsch commented on patch set 6 07/28/25, 15:37
Reply
No need for a new type IMO. We should just need a new TCA config option for type=input.DataHandler.php:1322ReplyWould like to have an opinion from @lolli@schwarzbu.ch here.DataHandlerHook.php:47ReplySure that's what a renderType is for. I just want to ensure we do evaluate it in DH context. We did this previously already and then migrated all those usages to dedicated tca types instead. -
Josua Vogel commented on patch set 6 07/28/25, 15:49
Reply
Okay, that´s possible. The only drawback would be, that the new config option isn´t located inside EXT:form, instead we extend the type in EXT:backend. Or do I miss an option to define a new config option for an existing TCA type inside another extension?
-
Oli Bartsch commented on patch set 6 07/28/25, 16:22
Reply
Adding an option basically means it is evaluated somewhere. So the place where it is evaluated matters. But, I could think of a new `renderType` resulting in a dedicated Element class which then checks tor this option to add custom client side logic. Additionally we then need to evaluate this option (independent of the renderType) in the DH. I'm ad-hoc not quite sure if this is completely possible via hooks. That's why I cc'ed Christian. -
Josua Vogel updated the commit message in patch set 7
V +107/28/25, 16:53 -
core-ci voted on patch set 7 V +1 07/28/25, 17:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82441
-
Garvin Hicking updated the commit message in patch set 8
V +107/30/25, 15:32 -
core-ci voted on patch set 8 V +1 07/30/25, 15:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82556
-
Josua Vogel commented on patch set 8 08/13/25, 19:31
DataHandler.php:1322Replyhi @lolli@schwarzbu.ch what’s your opinion on this? -
Christian Kuhn commented on patch set 8 08/22/25, 14:57
thanks for the patch. i'm aware not being able to use placeholders in the flex overrides is an issue. the patch is a bit intrusive, though, and i wonder if we couldn't 'fix' this differently: first, i'm neither a fan of the new DH hook (we shouldn't add more hooks they give additional headaches, we should fix the server side validation issue when DH has been refactored to support this is a good way, instead). furthermore, extending InputElement is fishy, those classes should be final and shouldn't be extendable. what do you think about fixing the issue more straight forward? We simply switch from type-email to type-input and stop validating email-adresses at this point. this gives freedom to use placeholders, with the drawback of not giving editor feedback in case they don't submit valid emails anymore. I think that would be acceptable considering the headaches with the given solution?! We could then see if we could validate the given data after placeholder substitution happened (if that is not the case already?), maybe when the form is rendered or a form is sent, or maybe as a note after sending using the additional 'information' API of FormEngine or something like that? This would release us from messing around with DH at this point and could lead to an acceptable solution as well? Do you think it is worth looking into something like that? On a different note: I think the 'dynamic' creation of flex form stuff in ext:form is flawed in the first place, not only codewise, but also strategically, but I'm also unsure on how to change this in a good way. And that is only *one* problem with ext:form ... As such, I'm very happy Josua is pushing patches in various areas of the module and I hope further people review the changes. -
Josua Vogel uploaded patch set 9
V +109/04/25, 15:05 -
Josua Vogel uploaded patch set 10 09/04/25, 15:05
-
Josua Vogel uploaded patch set 11 09/04/25, 15:06
-
Josua Vogel commented on patch set 11 09/04/25, 15:09
The bug fix has been updated so that it resolves the issue without interfering too deeply. Unfortunately, JavaScript validation is not possible. The custom eval function can only be used to manipulate values, but not to trigger validation errors. In my opinion, a universal solution should be created, but not via this bug fix. -
Josua Vogel commented on patch set 11 09/04/25, 15:10
Reply
DoneDataHandler.php:1322ReplyDoneDataHandlerHook.php:30ReplyDoneDataHandlerHook.php:47ReplyDone -
core-ci voted on patch set 9 V -1 09/04/25, 15:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84386
-
core-ci voted on patch set 10 V -1 09/04/25, 15:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84387
-
core-ci voted on patch set 11 V +1 09/04/25, 15:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84388
-
Garvin Hicking commented on patch set 11 09/04/25, 16:36
EmailOrFormElementIdentifier.php:23```suggestion * Triggered from DataHandler as TCA formevals hook for validation / sanitization of domain values. ```EmailOrFormElementIdentifier.php:30```suggestion * Server-side removing of invalid email value on save ```EmailOrFormElementIdentifier.php:38```suggestion if (!$isValidEmail && !preg_match('/^\{[^\}]+\}$/', $value)) { ``` Maybe anchoring start/end is useful here? Input like "{email1-id},{receiver}" or so is not valid, right?EmailToSender.yaml:60This wasn't type:email before, so could people enter something like '"user" <some@example.com>"' and allow it to be passed? -
Josua Vogel commented on patch set 12
V +109/04/25, 16:56Published edit on patch set 11. -
Josua Vogel commented on patch set 12 09/04/25, 16:56
EmailOrFormElementIdentifier.php:23ReplyFix applied.EmailOrFormElementIdentifier.php:30ReplyFix applied.EmailOrFormElementIdentifier.php:38ReplyFix applied.EmailToSender.yaml:60Replyno, sender name is an extra field. this is just an inconsistency -
core-ci voted on patch set 12 V +1 09/04/25, 17:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84392
-
Garvin Hicking commented on patch set 12 CR +1 V +1 09/06/25, 20:44
I think this is improving the situation. Waiting for @lolli@schwarzbu.ch however, please. -
Garvin Hicking updated the commit message in patch set 13
CR +1V +109/19/25, 10:52 -
core-ci voted on patch set 13 V +1 09/19/25, 10:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85162
-
Christian Kuhn commented on patch set 13 CR +1 V +1 09/19/25, 11:47
garvin and me looked at this for quite a while now - the solution is not optimal when persisting the record. but it's better than before. we'll follow this path for now and may improve client side with another patch. -
Garvin Hicking voted on patch set 13 CR +2 V +2 09/19/25, 11:48
-
Garvin Hicking merged patch set 14 09/19/25, 12:02