Project

General

Profile

Actions

Bug #106547

closed

$config Parameter passed to ItemsProcFunc does not contain a concrete Site when editing a page-translation

Added by Philipp Wrann 18 days ago. Updated 12 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
Start date:
2025-04-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In translations the "site" field of the $config parameter contains a NullSite.

I don't know, if this has been fixed in V13/V14 but it is valid for V12. Also i don't know, if this affects other record types as well.

I wouldn't target the patchlevel if it was true for all languages but having different parameters depending on the language seems very odd.


Files

Actions #1

Updated by Philipp Wrann 18 days ago

If you are dealing with a flex-field, you can workaround this by adding something like this (this can easily be adopted and applied for non-flex context):

if ($config['site'] instanceof Site) {
    $site = $config['site'];
} elseif ($config['table'] === 'pages' && !empty($config['flexParentDatabaseRow']['l10n_parent'])) {
    // @see https://forge.typo3.org/issues/106547
    $site = $this->siteFinder->getSiteByPageId((int) $config['flexParentDatabaseRow']['l10n_parent']);
} else {
    $site = null;
}

Of course you would have to inject the SiteFinder into your class

Actions #2

Updated by Georg Ringer 12 days ago

Hey Philipp,

thanks for reporting this issue. I just checked and this works fine in v14/v13, see screenshot attached

As v12 is in priority bugfix mode, we won't fix it there anymore and I am closing the issue

Actions

Also available in: Atom PDF