Bug #106547
closed$config Parameter passed to ItemsProcFunc does not contain a concrete Site when editing a page-translation
0%
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
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
Updated by Georg Ringer 12 days ago
- File Bildschirmfoto 2025-04-16 um 09.25.29.png Bildschirmfoto 2025-04-16 um 09.25.29.png added
- Status changed from New to Closed
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