Skip to content

[BUGFIX] Throw a speaking exception on missing summary mail settings - #79

Merged
BastiLu merged 3 commits into
in2code-de:developfrom
t3-vfm:feature/fix-summary-mail-missing-configuration
Sep 18, 2026
Merged

BastiLu merged 3 commits into
in2code-de:developfrom
t3-vfm:feature/fix-summary-mail-missing-configuration

Conversation

@t3-vfm

@t3-vfm t3-vfm commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What

ConfigurationService::getTypoScriptSettingsByPath() returns an empty string when the given path
cannot be resolved. SendSummaryService used that return value as an array:

$configuration = $this->configurationService->getTypoScriptSettingsByPath('commandControllers.summaryMail');
return [$configuration['fromEmail'] => $configuration['fromName']];

which fails with

TypeError: Cannot access offset of type string on string
in Classes/Domain/Service/Email/SendSummaryService.php line 62

The configuration is now resolved once, validated, and reused by getSender(), getSubject() and
getMailTemplate(). A missing configuration raises a ConfigurationException naming the TypoScript
path that has to be included.

Why it matters

The TypeError points at SendSummaryService instead of the actual cause: the static TypoScript of
EXT:lux is not part of the TypoScript template of the site the command runs against.

Multi-site installations run into this easily, because ExtbaseCommandTrait::initializeExtbase()
binds the request to SiteService::getDefaultSite() — which is current($siteFinder->getAllSites()),
i.e. the first site in filesystem order, not necessarily the site lux is configured for. Tracking
down the real cause from that error message takes a while.

Behaviour change

getSubject() and getMailTemplate() previously fell back to an empty string when the whole
configuration branch was missing, producing a mail with an empty subject or an unresolvable template
path. They now raise the same ConfigurationException. Individual missing keys still fall back to
an empty string via ??, so partial configurations behave as before.

Verified

Against 44.3.0 in a TYPO3 13.4 / PHP 8.2 installation:

  • without the TypoScript: ConfigurationException with the path in the message, instead of the
    TypeError
  • with the TypoScript: summary mail for 12 leads rendered and sent as before, correct subject and
    sender

Related

The non-deterministic site selection in SiteService::getDefaultSite() is the second half of this
problem and is reported separately in #80 — this PR only makes the failure understandable.

ConfigurationService::getTypoScriptSettingsByPath() returns an empty
string when the given path cannot be resolved. SendSummaryService used
that return value as an array, which fails with

  TypeError: Cannot access offset of type string on string

The error points at SendSummaryService instead of the actual cause: the
static TypoScript of EXT:lux is not part of the TypoScript template of
the site the command runs against. Multi-site installations run into
this easily, because ExtbaseCommandTrait binds the request to
SiteService::getDefaultSite(), which is the first site returned by the
SiteFinder and not necessarily the site lux is configured for.

The configuration is now resolved once, validated, and reused by
getSender(), getSubject() and getMailTemplate(). A missing configuration
raises a ConfigurationException naming the TypoScript path that has to
be included.
@BastiLu
BastiLu self-requested a review September 18, 2026 13:11
@BastiLu
BastiLu merged commit 8347347 into in2code-de:develop Sep 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants