Review main Abandoned

90120[BUGFIX] Fix custom loginLogo FluidEmail absolute path in CLI context

Garvin Hicking CR 0 V -1 Normal +244 −1 updated 09/04/26, 06:29

Commit message

The path creation of FluidEmail SystemMail default mails
utilizes the ViewHelper `core:normalizedUrl`, which then constructs
"EXT:..." notation paths using `GU:locationHeaderUrl()`, which then
utilizes direct $_SERVER[] context variables (`TYPO3_REQUEST_DIR` ->
`TYPO3_REQUEST_HOST` -> `HTTP_HOST` + `SCRIPT_NAME`).

This will not work in CLI environments, leading to created URIs like:

```
http://vendor/bin/typo3conf/ext/mysitepackage/Resources/Public/Images/backend/provider.png
```

The CLI bootstrap of a FluidEmail allows to set a custom server request,
which in turn can set the Site context (see [1]), which would also be
available within the SystemEmail template, but was not evaluated
for path generation.

With this patch, the `{normalizedParams.siteUrl}` argument is passed
and evaluated in the ViewHelper to build `EXT:...` notation URIs
using Site context, if available.

Tests are added for several variants of possible URI generation of the
logo.

[1] https://www.derhansen.de/2022/06/using-typo3-fluidemail-in-cli-context.html

Review

  • Code review CR 0
  • Verified V -1
    • core-ci -1 CI

Issues 2

Files 3

Review log 1317

  1. Garvin Hicking uploaded patch set 1 07/22/25, 12:08

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

  3. Garvin Hicking commented on patch set 1 07/22/25, 12:43

    Please note: This is in part a solution similar to https://review.typo3.org/c/Packages/TYPO3.CMS/+/77249 (which I only found afterwards). The alternate approach to inline the SVG image into the Mail is still open. I think we can have our cake, and eat it too, and be able to cover both scenarios (inline+external).
  4. Garvin Hicking uploaded patch set 2 V +1 07/22/25, 17:43

    Use the port garv
  5. core-ci voted on patch set 2 V -1 07/22/25, 17:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82136

  6. Garvin Hicking commented on patch set 3 V -1 07/22/25, 17:55

    Published edit on patch set 2.
  7. core-ci voted on patch set 3 V +1 07/22/25, 18:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82137

  8. Peter Kraume voted on patch set 3 CR +1 V +1 07/22/25, 18:40

  9. Andreas Wolf voted on patch set 3 CR +1 08/07/25, 21:54

  10. Stefan Bürk commented on patch set 3 CR -1 08/11/25, 00:16

    Unresolved

    Temp -1 to have the change to review and think about this ...
  11. Stefan Bürk commented on patch set 3 08/11/25, 00:44

    NormalizedUrlViewHelper.php:55 Unresolved

    Putted already `-1` to review it in depth and decided to add the points doing crazy jumps and loops in my brain directly here: This is a "try" to fix the overall issue that CLI has not a valid FQDN context, unless some command and etc sets that correctly and I think that we should not male this "bugfix" ... a proper context should be created (request, global request including resetting the `GeneralUtility::$indpEnvCache` cache each time the overall state is changed in cli. We need to stay away distributing nasty hacks for cli context trying to heal all these similar symptoms instead of banning the root cause of all these symptoms - which is not that "easy": * Enforcing `FQDN` for SiteConfiuration (at a minimum / breaking ) * Going through brainmelting process to answer the "how to ensure a properly enforced/working global state in cli - always" - which can be adopted (keyword: single/multi site root instances / multiple tenants (customer) pages, ...) From the commit message: ``` The CLI bootstrap of a FluidEmail allows to set a custom server request, which in turn can set the Site context (see [1]), which would also be available within the SystemEmail template, but was not evaluated for path generation. ``` I'd say resetting the `GeneralUtility::$indpEnvCache` needs to be added when setting the sitecontext / custom request (request needs to be set/provided as `$GLOBALS['TYPO3_REQUEST`]` and the faked `$_SERVER` (and we should cat rid of that indpv thing anyway dealing still with superglobals). Not really a fan of adding a new "viewhelper" option here trying to fix another symptom of the same curse/issue instead of working on that. Mainly because that becomes api in that case
  12. Benni Mack updated the commit message in patch set 4 CR +1 V +1 04/22/26, 06:33

  13. Garvin Hicking marked it work in progress 04/22/26, 07:19

  14. Garvin Hicking commented on patch set 4 04/22/26, 07:20

    Unresolved

    This can be revisited, with TemplatedMailFactory we have better options now.
  15. core-ci voted on patch set 4 V -1 04/22/26, 07:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100732

  16. Benni Mack commented on patch set 4 09/03/26, 22:05

    hey garvin, I would abandon your change in favor of https://review.typo3.org/c/Packages/TYPO3.CMS/+/75727
  17. Garvin Hicking abandoned the change 09/04/26, 06:29

    abandoning as suggested, fine!