not possible to edit pages with sys_language_uid > 9 with SiteHandling
I have a system with 10 languages and several RootPages. Each RootPage has the default language and a translation.
The languages are assigned via sitehandling.
If I assign a Rootpage the language 10 I can not edit these over the module "Pages" and get the following error message
(1/1) #1522960188 InvalidArgumentException Language 1 does not exist on site xx.
I would like to edit the language with the UID 10, but get the error message the language with the Uid 1 is not available.
The Error is in \TYPO3\CMS\Backend\Form\Element\InputSlugElement::class (InputSlugElement.php) on line 67:
66 - $languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField']; 67 - $languageId = (int)($row[$languageField] ?? 0); 68 - $baseUrl = $this->getPrefix($this->data['site'], $languageId);
$languageField is for table pages 'sys_language_uid' and $row has
$row[ ... 'sys_language_uid' = 10 ... ];
so with line 67 we get only the '1' instead of '10'
so line 67 sould changed to:
67 - $languageId = (int)($row[$languageField] ?? 0);
Updated by Daniel Goerz about 2 years ago
This bug pointed to a different issue that lies a bit deeper.
The value of the
sys_language_uid field of the
pages table is an array if properly processed by formEnging (see
However, since the removal of pages_language_overlay the sys_language_uid is passed as overrideVals to the formEngine (GET parameter
overrideVals[pages][sys_langauge_uid]). This was streamlines in the core with #86754.
In case overrideVals are set, the
TcaSelectItems will NOT process the field sys_language_uid because the type is set to
hidden during runtime. This results in the value arriving in the
InputSlugElement will not be an array.
Since it is still possible for a custom edit functionality to not set the overrideVals, the InputSlugElement needs to be able to handle both cases.
How can you test this?
Edit a page with and without the overrideVals GET parameter and check that the
InputSlugElement determines the ID correctly in both cases.