#104851Error upon localization configuration via TsConfig
Description
i wanted to try TYPO3 13.2.1 and test some TsConfig options.
Case:
I have 2 languages defined. It doesnt matter what the translation behavior is, the error appears on all 3 modes. Using either of those 2 settings, produces the error.
mod.web_layout {
localization {
enableCopy = 0
enableTranslate = 0
}
}
The error that appears (503):
> Core: Exception handler (WEB): Uncaught TYPO3 Exception: Cannot assign string to property TYPO3\CMS\Backend\View\Drawing\DrawingConfiguration::$allowTranslateModeForTranslations of type bool | TypeError thrown in file /myPath/vendor/typo3/cms-backend/Classes/View/Drawing/DrawingConfiguration.php in line 99. Requested URL: https://example.com/typo3/module/web/layout?token=—AnonymizedToken—&id=1
Solution:
Theoritically:
Here https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/View/Drawing/DrawingConfiguration.php#L73 the allowTranslateModeForTranslations variable has been set to bool, but the https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/View/Drawing/DrawingConfiguration.php#L99C123-L100C69 return a string with the value 0. The same happens with the allowCopyModeForTranslations variable
Maybe typecast the array value
$obj->allowTranslateModeForTranslations = (bool)$pageTsConfig['mod.']['web_layout.']['localization.']['enableTranslate'] ?? true;
$obj->allowCopyModeForTranslations = (bool)$pageTsConfig['mod.']['web_layout.']['localization.']['enableCopy'] ?? true;
but i don’t know if adding a normal string as value via tsconfig will cause a problem for not properly typecasting. Something like that:
mod.web_layout {
localization {
enableCopy = a string value
enableTranslate = some other string value
}
}Reviews 1
Related issues 1
Files 1
History 56
-
Aristeidis Karavas changed description 09/07/24, 10:41
-
Benjamin Franzke changed Related to #103345 10/07/24, 13:05
-
Benjamin Franzke changed status
NewAccepted assigned to Benni Mack 10/07/24, 13:06 -
Gerrit Code Review pushed patch set 1 for main to change 86448 status
AcceptedUnder Review 10/07/24, 13:07 -
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % 10/07/24, 13:25 -
Benni Mack changed status
ResolvedClosed 10/15/24, 09:06
Applied in changeset commit:79d5daa6911b35e9222d2a70c0e486d48891596e.