Review main Merged

88883[FEATURE] Use YamlFileLoader when creating new form from templates

Uwe Wiebach CR +2 V +2 Normal +113 −2 updated 09/22/25, 13:18

Commit message

Load the form template file in FormManagerController's create function
via the load function of class YamlSource to make use of the
YamlFileLoader. This enables the processing of placeholders within the
template file (e.g. %env(ENV_NAME)%).

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Josua Vogel +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Josua Vogel +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 3242

Show 1317 earlier messages
  1. Uwe Wiebach uploaded patch set 1 04/01/25, 15:38

  2. core-ci voted on patch set 1 V +1 04/01/25, 15:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76799

  3. Georg Ringer updated the commit message in patch set 2 V +1 04/02/25, 05:31

  4. Georg Ringer commented on patch set 2 04/02/25, 05:32

    can we change the test so the new change is shown as well?
  5. core-ci voted on patch set 2 V +1 04/02/25, 05:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76837

  6. Uwe Wiebach commented on patch set 2 04/02/25, 08:31

    Reply

    What exactly do you mean? Writing a test for creating a new form from a template with placeholders? As far as I can see, there is no test for the create action at all, is there? That said, I'm not really into test writing yet, so I don't know if I could provide that. But I'd give it a try if you point me in the right direction...
  7. Mathias Brodala commented on patch set 2 04/02/25, 11:22

    Does this replace the placeholders for editing or keep them displayed as such? Also does this ensure that the placeholders are kept when saving? Or are they replaced with their resolved values?
  8. Uwe Wiebach commented on patch set 2 04/02/25, 11:51

    Reply

    The placeholders are replaced by their values. That is the whole purpose of this change. This Monday I wrote in the ext-form slack channel what I intend to do with it. In short, I need this for a default value that should not be hardcoded in the template. The value can be edited afterwards and it is not intended to store the placeholder itself in the form definition...
  9. Mathias Brodala commented on patch set 2 04/02/25, 11:53

    Reply

    That's a valid usecase. But keeping the placeholders unchanged is also a valid usecase, e.g. to continue having the values injected at runtime (form render/submit). IMO it should at least be clarified/documented if this is something to have and/or implemented.
  10. Uwe Wiebach commented on patch set 2 04/02/25, 12:10

    Reply

    But keeping it unchanged doesn't work in our use case, as the placeholder sets the value of an integer field (page uid). Of course, the form editor won't let you save it because it's not a valid value. And (what would bother me more): editors using the template to create a new form will surely be confused by the placeholder...
  11. Uwe Wiebach uploaded patch set 3 V +1 06/06/25, 11:34

  12. Mathias Brodala commented on patch set 3 06/06/25, 11:35

    Reply

    Maybe we could add a custom YAML placeholder processor using "placeholderProcessors".
  13. core-ci voted on patch set 3 V +1 06/06/25, 11:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79986

  14. Uwe Wiebach commented on patch set 3 06/11/25, 12:39

    Reply

    That's exactly what I'm trying to do here. See https://typo3.slack.com/archives/C093RB4P9/p1743180641782979
  15. Uwe Wiebach rebased onto patch set 4 V +1 06/25/25, 11:07

  16. core-ci voted on patch set 4 V +1 06/25/25, 11:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80844

  17. Oliver Hader uploaded patch set 5 V +1 07/24/25, 20:23

  1. core-ci voted on patch set 5 V -1 07/24/25, 20:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82275

  2. Oliver Hader commented on patch set 5 CR +1 V +1 07/24/25, 20:33

    For static files (not FAL File) this now uses the YamlFileLoader of the core, which implicitly enables processing imports and processing placeholders. For static files, that were explicitly allowed by `newFormTemplates.templatePath`, it looks good from a security point of view. I've added a test case to verify and demonstrate the behavior.
  3. Oliver Hader uploaded patch set 6 CR +1 V +1 07/24/25, 20:35

  4. Oliver Hader voted on patch set 6 CR +1 V +1 07/24/25, 20:36

  5. Oliver Hader commented on patch set 6 CR 0 07/24/25, 20:38

  6. core-ci voted on patch set 6 V +1 07/24/25, 20:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82276

  7. Oliver Hader uploaded patch set 7 V +1 07/24/25, 20:53

  8. core-ci voted on patch set 7 V +1 07/24/25, 21:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82277

  9. Oliver Hader uploaded patch set 8 V +1 07/24/25, 21:53

  10. Oliver Hader commented on patch set 7 07/24/25, 21:53

    Reply

    Done
  11. Oliver Hader voted on patch set 8 CR +1 V +1 07/24/25, 21:55

  12. core-ci voted on patch set 8 V +1 07/24/25, 22:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82283

  13. Garvin Hicking uploaded patch set 9 CR +1 V +1 09/18/25, 20:22

  14. Garvin Hicking commented on patch set 9 CR +1 09/18/25, 20:25

    rebased and fixed merge conflict
  15. core-ci voted on patch set 9 V +1 09/18/25, 20:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85129

  16. Garvin Hicking voted on patch set 9 V +1 09/18/25, 20:45

  17. Josua Vogel commented on patch set 9 09/22/25, 11:51

    FormManagerControllerTest.php:72

    in some other tests, "putenv" is added in the test method, not inside "setUp". That might be better because the other tests do not need this environment variable.

    FormManagerControllerTest.php:705

    Shouldn't we instead first implement the test like the others and implement the creation of the route from the Symfony route as soon as the merge request is complete?
  18. Garvin Hicking commented on patch set 9 09/22/25, 12:26

    FormManagerControllerTest.php:705 Reply

    I think being able to merge either with enough votes would be fine 😬
  19. Josua Vogel commented on patch set 9 09/22/25, 12:34

    FormManagerControllerTest.php:705 Reply

    Acknowledged
  20. Josua Vogel uploaded patch set 10 CR +1 V +1 09/22/25, 12:50

  21. Josua Vogel commented on patch set 10 09/22/25, 12:51

    Reply

    Acknowledged

    FormManagerControllerTest.php:72 Reply

    Done
  22. Josua Vogel voted on patch set 10 CR +1 V +1 09/22/25, 12:53

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

  24. Garvin Hicking voted on patch set 10 CR +2 V +2 09/22/25, 13:18

  25. Garvin Hicking merged patch set 11 09/22/25, 13:18