Bug #43668
closedRootline in TSFE->tmpl is broken when translation is used
Added by Helmut Hummel almost 12 years ago. Updated about 7 years ago.
100%
Description
The fix in #42029 introduced a regression
as TSFE->tmpl->rootLine holds a reversed
rootline array, while in TSFE->rootLine
the order is "normal"
Additionally the call to getPageOverlay was wrong
because the result of the overlay was never used.
Files
rootline_bug.jpg (84.6 KB) rootline_bug.jpg | Sven Wappler, 2013-03-03 22:45 |
Updated by Gerrit Code Review almost 12 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16992
Updated by meolus almost 12 years ago
EDIT: The patch from above solves my both problems!
I'm using TYPO3 6.0 and tested TYPO3 6.1-dev from yesterday, but I have similar problems with rootlines and translations. My first problem was, that the following TS snippets don't return the correct translation (they always return the translation in default language):
something = TEXT
something.data = leveltitle:1
respectively
somethingOther = TEXT
somethingOther.data = fullRootLine:1, title
My searching endet up in #42029. Undoing the changes in typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php resolved my problem for now, but I am not sure about it:
// Updating content of the two rootLines IF the language key is set!
if ($this->sys_language_uid && is_array($this->tmpl->rootLine)) {
foreach ($this->tmpl->rootLine as $rLk => $value) {
$this->tmpl->rootLine[$rLk] = $this->sys_page->getPageOverlay($this->tmpl->rootLine[$rLk]);
}
//$this->tmpl->rootLine = $this->sys_page->getRootLine($this->id, $this->MP);
}
if ($this->sys_language_uid && is_array($this->rootLine)) {
foreach ($this->rootLine as $rLk => $value) {
$this->rootLine[$rLk] = $this->sys_page->getPageOverlay($this->rootLine[$rLk]);
}
//$this->rootLine = $this->sys_page->getRootLine($this->id, $this->MP);
}
(relating to Patch of #42029).
Additional I've a problems with translations and realurl, just like #42880, too. So I don't think it was fixed.
Updated by Sengchheang Chhun almost 12 years ago
The path solves my problem too.
I wrote TypoScript (HMENU, special=rootline) to output breadcrumb.
In English, the breadcrumb is like this:
Home > Contact > Sub of Contact
But in translated version:
Sub of Contact > Contact > Home
After patching, it is working now.
Updated by Gerrit Code Review almost 12 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16992
Updated by Gerrit Code Review almost 12 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16992
Updated by Gerrit Code Review almost 12 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16992
Updated by Gerrit Code Review almost 12 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16992
Updated by Gerrit Code Review almost 12 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16992
Updated by Gerrit Code Review almost 12 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/17475
Updated by Helmut Hummel almost 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 025887dba6370dbfd50284a9f01d43d7f2b699ec.
Updated by Sven Wappler over 11 years ago
Only meolus patch (Note #2) solves the problem for me. Please patch the core with his suggestion.
Updated by Helmut Hummel over 11 years ago
Sven Wappler wrote:
Only meolus patch (Note #2) solves the problem for me. Please patch the core with his suggestion.
Can you explain you exact problem you have with TYPO3 6.0.2 regarding rootline and translations?
Updated by Sven Wappler over 11 years ago
If I do not use the patch, I see only the first page on level 0 when switching to another language. Once I use the patch, all translations are available and the pages are accessible.
Therefore I wonder why it functions for you without the patch.
Updated by Helmut Hummel over 11 years ago
Sven Wappler wrote:
If I do not use the patch, I see only the first page on level 0 when switching to another language.
Where do you see only the root level page? In the menu?
What exact setup do you have?
Once I use the patch, all translations are available and the pages are accessible.
Therefore I wonder why it functions for you without the patch.
What exact TYPO3 Version are you referring to and what exact patch on top of that version helps?
Updated by Sven Wappler over 11 years ago
- File rootline_bug.jpg rootline_bug.jpg added
TYPO3 version: 6.0.0 - 6.0.2 and master.
The patch for typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php function updateRootlinesWithTranslations()
Changing
if ($this->sys_language_uid && is_array($this->tmpl->rootLine)) { $this->tmpl->rootLine = $this->sys_page->getRootLine($this->id, $this->MP); } if ($this->sys_language_uid && is_array($this->rootLine)) { $this->rootLine = $this->sys_page->getRootLine($this->id, $this->MP); }
to
if ($this->sys_language_uid && is_array($this->tmpl->rootLine)) { foreach ($this->tmpl->rootLine as $rLk => $value) { $this->tmpl->rootLine[$rLk] = $this->sys_page->getPageOverlay($this->tmpl->rootLine[$rLk]); } } if ($this->sys_language_uid && is_array($this->rootLine)) { foreach ($this->rootLine as $rLk => $value) { $this->rootLine[$rLk] = $this->sys_page->getPageOverlay($this->rootLine[$rLk]); } }
I added a screenshot which is showing the problem.
Updated by André Steiling over 11 years ago
I got the same behaviour as Sven Wappler descriped. Without changing typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php function updateRootlinesWithTranslations() I only see the defined rootline pages and not my menus!
I work with TYPO3 6.0.4 and
config {
linkVars = L(0|1)
uniqueLinkVars = 1
sys_language_uid = 0
language = de
locale_all = de_DE.UTF-8
sys_language_mode = default
}
After patching updateRootlinesWithTranslations() my menus work as expected, but my translated content is not shown on a translated page - a next issue ...
Updated by Sven Wappler over 11 years ago
Will this bug be fixed? It does still exist in 6.1.0. Please reopen this bug.
Updated by Martin Holtz over 11 years ago
Sven Wappler wrote:
Will this bug be fixed? It does still exist in 6.1.0. Please reopen this bug.
IMHO this bug is fixed, but there is another bug which depends on is_siteroot is not set on the root page, but somewhere in the rootLevel. I filled a new bug report: [[http://forge.typo3.org/issues/49827]] Seems that you have the same problem.
Updated by Sven Wappler over 11 years ago
Ok, it seems that this bug is now finally fixed in 6.1.2
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed