Issue Bug Closed

#93544Template overriding for FluidMail ignoring index of path

Tobias Kummer 02/18/21, 10:25 updated 10/13/26, 15:30

Description

We have to extensions: cart (cart extension with default email templates) and lst_lwo which overrides some of the cart email templates

Cart ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['MAIL']['templateRootPaths']['1588829280'] = 'EXT:cart/Resources/Private/Templates/';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['partialRootPaths']['1588829280'] = 'EXT:cart/Resources/Private/Partials/';

lst_lwo ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['MAIL']['templateRootPaths'][1613456229] = 'EXT:lst_lwo/Resources/Private/Extensions/Cart/Templates/';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['partialRootPaths'][1613456229] = 'EXT:lst_lwo/Resources/Private/Extensions/Cart/Partials/';

Results in the image “Backend $GLOBALS[‘TYPO3_CONF_VARS’]”.

If I debug in FE (instance of FluidEmail), then I find the following (see other image “Frontend debug of FluidEmail instance”).

Although the index of “lst_lwo” overriding is higher then the one of “cart”, cart templates comes on last position.

Workaround: If I add a dependency to “cart” in “lst_lwo”, all works like expected.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 2

History 4

  1. Ramon Zöllner commented <span data-processor="relativetime" data-value="2022-02-10T09:38:00+00:00" > 02/10/22, 09:38 </span>

    I ran into this issue as well and this is what I found:

    Short Version
    the sorting of paths is skipped when using the constructor of

    TYPO3Fluid\Fluid\View\TemplatePaths

    with an array.

    Longer Version

    In FluidEmail::initializeView we have

    $templatePaths = $templatePaths ?? new TemplatePaths($GLOBALS['TYPO3_CONF_VARS']['MAIL']);

    The constructor of TYPO3Fluid\Fluid\View\TemplatePaths calls

    TemplatePaths::fillFromConfigurationArray

    which extracts the different path parts via

    TemplatePaths::extractPathArrays

    but during this process the numerical indices are lost and the paths can not be sorted later.

    Normally the TYPO3 implementation of TYPO3\CMS\Fluid\View\TemplatePaths takes care of path sorting, but only for paths that are configured in TypoScript (as far as I can tell).

    As the error is not limited to Mailer, but all instances where template overriding is done in PHP and not TypoScript, I think this is more of a Fluid issue than Mailer API.

  2. Hartmut Steglich commented and changed TYPO3 Version 10 11 <span data-processor="relativetime" data-value="2022-06-02T13:50:27+00:00" > 06/02/22, 13:50 </span>

    Same issue still with TYPO3 11.5.10

    Are there any workarounds (like using TS)?

  3. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-10-13T15:30:53+00:00" > 10/13/26, 15:30 </span>

    Fixed in c768d0fd534 and TYPO3 v13 LTS.