Bug #85063
closed\TYPO3\CMS\Frontend\Typolink\PageLinkBuilder::build doesn't honor l18n_cfg settings
100%
Description
Links to a page within TYPO3, that has the l18n_cfg flag set for "Hide default translation of page", result in TYPO3 creating broken links which leads to a 404 error.
How to reproduce:- create a page and enable "Hide default translation of page" in page settings
- go somewhere else and create a link to that page e.g. in the RTE
Current behavior:
TYPO3 creates a link to the page but the link broken (404)
Expected behavior:
TYPO3 should not create the link
Scope of the problem:
This bug effects all places where, e.g. $this->cObj->typoLink_URL() is used.
- TypoScript and typolink usage
- any record that has a link field (tt_content, tx_news, etc.)
I haven't checked it yet, but I assume that TYPO3 7.6 is affected as well.
Updated by Gerrit Code Review almost 6 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57038
Updated by Gerrit Code Review almost 6 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57038
Updated by Tymoteusz Motylewski almost 6 years ago
- Related to Bug #82122: Typo3DbBackend::doLanguageAndWorkspaceOverlay ignores pages l18n_cfg added
Updated by Tymoteusz Motylewski almost 6 years ago
- Related to Bug #84139: l18n_cfg not respected in sysext/frontend/Classes/Page/PageRepository.php added
Updated by Tymoteusz Motylewski almost 6 years ago
- Related to Bug #75014: l18n_cfg not respected in fluid_styled_contents of type special menu added
Updated by Gerrit Code Review almost 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57038
Updated by Gerrit Code Review almost 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57038
Updated by Gerrit Code Review almost 6 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57038
Updated by Gerrit Code Review almost 6 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57038
Updated by Gerrit Code Review almost 6 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57038
Updated by Gerrit Code Review almost 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57116
Updated by Georg Ringer almost 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7e8a72cfde06597eca5c4d30ecbdb6b3ab7a541d.
Updated by Gerrit Code Review almost 6 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57116
Updated by Gerrit Code Review almost 6 years ago
Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57116
Updated by Gerrit Code Review almost 6 years ago
Patch set 4 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57116
Updated by Anja Leichsenring almost 6 years ago
- Related to Bug #85149: \TYPO3\CMS\Frontend\Page\PageRepository::getPage needs to care about version overlay added
Updated by Gerrit Code Review almost 6 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57276
Updated by Benni Mack almost 6 years ago
- Related to Task #85339: Revert "Honor l18n_cfg in PageRepository" added
Updated by Benni Mack almost 6 years ago
- Status changed from Under Review to Accepted
Updated by Gerrit Code Review almost 6 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57345
Updated by Nicole Cordes almost 6 years ago
- Status changed from Under Review to Resolved
Applied in changeset 416efd8d7ebde15787c0778856f45a2557fb3430.
Updated by Lorenz Ulrich about 5 years ago
The code introduced to TYPO3 8.7 breaks a use-case of mine. I'm not sure if it is valid, so I hope someone can help me validate:
(Simplified) situation: TYPO3 8.7 site with two languages German (default, 0) and English (1).
I want to create a link to a site that is configured to be hidden in the Default language (l18n_cfg = 1
). Obviously, I want to create a link to the English version of this page.
This is my code:
$targetUri = $GLOBALS['TSFE']->cObj->typoLink_URL(
[
'parameter' => 777,
'additionalParams' => '&L=1',
'forceAbsoluteUrl' => true,
]
);
Now, PageLinkBuilder->build
fetches the page with ID 777. At this point, it does not do a language overlay because the link is generated on a German page.
Therefore, the code introduced sets $language = 0;
because there is no _PAGES_OVERLAY
field in the record. So this leads the exception introduced with this change:
$language = empty($page['_PAGES_OVERLAY']) ? 0 : $page['_PAGES_OVERLAY_LANGUAGE'];
if ($language === 0 && GeneralUtility::hideIfDefaultLanguage($page['l18n_cfg'])) {
throw new UnableToLinkException('Default language of page "' . $linkDetails['typoLinkParameter'] . '" is hidden, so "' . $linkText . '" was not linked.', 1529527301, null, $linkText);
}
So it seems I cannot build an URL from the default language to a site that only exists in a non-default language.
Georg or Nicole, can you confirm this? Should this be possible or not?
Updated by Markus Klein about 4 years ago
- Related to Bug #90850: typolink generates links for non-reachable pages added