Project

General

Profile

Actions

Bug #104851

closed

Error upon localization configuration via TsConfig

Added by Aristeidis Karavas about 2 months ago. Updated 16 days ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Localization
Target version:
Start date:
2024-09-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.3
Tags:
localization, tsconfig
Complexity:
Is Regression:
Sprint Focus:

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
    }
}

Files

Screenshot 2024-09-07 at 13.35.17.png (44.4 KB) Screenshot 2024-09-07 at 13.35.17.png Aristeidis Karavas, 2024-09-07 10:35

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #103345: Fluid-based Page module has some naming issuesClosedBenni Mack2024-03-08

Actions
Actions #1

Updated by Aristeidis Karavas about 2 months ago

  • Description updated (diff)
Actions #2

Updated by Benjamin Franzke 24 days ago

  • Related to Task #103345: Fluid-based Page module has some naming issues added
Actions #3

Updated by Benjamin Franzke 24 days ago

  • Status changed from New to Accepted
  • Assignee set to Benni Mack
Actions #4

Updated by Gerrit Code Review 24 days ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86448

Actions #5

Updated by Benni Mack 24 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack 16 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF