Bug #102124
closedf:uri.page + language does not work (TypeError)
100%
Description
Type Error for language:'0'
TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setLanguage(): Argument #1 ($language) must be of type ?string, int given, called in /var/www/html/vendor/typo3/cms-fluid/Classes/ViewHelpers/Uri/PageViewHelper.php on line 236
Type Error after changing$language = $arguments['language'] ?? null;
to$language = isset($arguments['language']) ? (string)$arguments['language'] : null;
TYPO3\CMS\Core\Context\LanguageAspect::__construct(): Argument #1 ($id) must be of type int, string given, called in /var/www/html/vendor/typo3/cms-frontend/Classes/Typolink/PageLinkBuilder.php on line 416
Changing$page = $pageRepository->getLanguageOverlay('pages', $page, new LanguageAspect($configuration['language'], $configuration['language']));
to$page = $pageRepository->getLanguageOverlay('pages', $page, new LanguageAspect((int)$configuration['language'], (int)$configuration['language']));
does the job then.
Note: language can be "current" so it can be a string, but for the second change there is $configuration['language'] !== 'current' around it, so casting as int should be okay at this place
Updated by Gerrit Code Review about 1 year ago
- Status changed from New 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/+/81382
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81342
Updated by Gerrit Code Review about 1 year ago
Patch set 2 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/+/81382
Updated by Gerrit Code Review about 1 year ago
Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81342
Updated by Kevin Appelt about 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5ae7e949319cf68beaf511b93eef086c2dcc1e9e.