Bug #48300

Entrylevel wrong when switching languages

Added by Florian Scholz over 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2013-05-16
Due date:
% Done:

100%

TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In a multi-language setup, I get different entrylevel outputs when switching from the default language (German) to another language (English)
Defined value is entrylevel = 1, however the English version behaves like there would have been set entrylevel = 0 in the TypoScript.

Any ideas?

Language settings:

config {
  linkVars = L  
  htmlTag_langKey = de_DE  
  sys_language_uid = 0
  language = de
  locale_all = de_DE
  sys_language_overlay = 1

}

// Language Englisch
[globalVar = GP:L = 1]
  config.linkVars = L
  config.sys_language_uid = 1
  config.language = en
  config.locale_all = en_GB
  config.htmlTag_langKey = en_GB
[global]

Menu TypoScript:

SUBNAVI = COA_INT     
SUBNAVI = HMENU
SUBNAVI {
entryLevel = 1

1 = TMENU

1 {

wrap = <ul class="subMnu">|</ul>
noBlur = 0
NO = 1
NO.wrapItemAndSub = <li class="subMnuSingleBlue">|</li>
CUR < .NO
CUR.ATagParams = class="act" 

IFSUB = 1
IFSUB.wrapItemAndSub = <li class="subMnuBlue">|</li>
CURIFSUB < .IFSUB
CURIFSUB.ATagParams = class="act" 

ACT = 1
ACT < .NO
ACTIFSUB < .CURIFSUB
}

2 = TMENU 
2 {   

wrap = <ul class="subMnu">|</ul>
NO = 1
NO.wrapItemAndSub = <li class ="subMnuGrey">|</li>
CUR < .NO
CUR.ATagParams = class="act" 
ACT = 1
ACT < .CUR   

}
}

(c.f. http://www.typo3.net/forum/beitraege/mehrsprachigkeit/114479/)

test_bug_48300.t3d (3.84 KB) Alexander Stehlik, 2013-05-31 13:17

Associated revisions

Revision 925ce3fa (diff)
Added by Alexander Stehlik over 6 years ago

[BUGFIX] Fix template rootline for translated pages

The TypoScript template rootline in the Frontend will not be
changed any more if a different sys_language_uid is used.

The data of the current rootLine will be overwritten with the
translated rootLine data.

Resolves: #48300
Releases: 6.2, 6.1
Change-Id: I38bd4a6f3d3c2f15712003b1d1a1334284ebe9b0
Reviewed-on: https://review.typo3.org/21174
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

Revision d5b2763d (diff)
Added by Alexander Stehlik over 6 years ago

[BUGFIX] Fix template rootline for translated pages

The TypoScript template rootline in the Frontend will not be
changed any more if a different sys_language_uid is used.

The data of the current rootLine will be overwritten with the
translated rootLine data.

Resolves: #48300
Releases: 6.2, 6.1
Change-Id: I38bd4a6f3d3c2f15712003b1d1a1334284ebe9b0
Reviewed-on: https://review.typo3.org/21449
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

History

#1 Updated by Philipp Gampe over 6 years ago

  • Status changed from New to Needs Feedback

Are you sure that you created translations for all pages?

#2 Updated by Philipp Gampe over 6 years ago

I can not reproduce this. Please share more details, best would be an export of a sample page tree including the TS.

#3 Updated by Jochen Weber over 6 years ago

same issue.
when i increment the entryLevel within a condition to the language(!=0), everything works like expected.
i also disabled the realurl-extension to exclude this. i will create an sample export next days...

#4 Updated by Jochen Weber over 6 years ago

the range of "special = rootline" also starts at the wrong point.
i defined a page with "is_siteroot", but in a other language as default, it is ignored.

#5 Updated by Alexander Stehlik over 6 years ago

I think i found the Problem in

\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::updateRootLinesWithTranslations()

In this method the rootline of the template is overwritten which look pretty dirty to me:

$this->tmpl->rootLine = array_reverse($this->sys_page->getRootLine($this->id, $this->MP));

The rootline of the template should be initialized by passing it to the start() method of the TemplateService (\TYPO3\CMS\Core\TypoScript\TemplateService::start($theRootLine)). Otherwise configuration options like "root" of the template are totally ignored.

The change was commited with 51f41665 and reviewed here: https://review.typo3.org/#/c/16992/

#6 Updated by Alexander Stehlik over 6 years ago

To test the problem you have two options:

  1. use config.sys_language_mode = content_fallback; 0
  2. add a language record to the sub root page

I attach a small page tree export where you can test the problem:

  1. in the TYPO3 root create a "Alternative Page Language" record (e.g. English) with UID 2
  2. import the t3d file
  3. navigate to page subroot1 - page 1.1 (has a language record)
  4. append &L=2 to URL

Expected behavior: The menu structure should not change

Current behavior: The menu is now linking to the root pages.

#7 Updated by Gerrit Code Review over 6 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21174

#8 Updated by Florian Scholz over 6 years ago

Can we please have this in a 6.1.x release? I consider this as a major bug.

#9 Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21174

#10 Updated by Gerrit Code Review over 6 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21174

#11 Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21449

#12 Updated by Alexander Stehlik over 6 years ago

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

#13 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF