[TYPO3-dev] [Fix] t3lib_page::getMenu does not check for existance of language overlay

Adam Nojszewski adam at nojszewski.coim
Thu Sep 27 12:33:44 CEST 2007


Hi

This is copy of http://bugs.typo3.org/view.php?id=6405
----
Function getMenu in t3lib_page class does not check for existence of 
current language version. This makes shortcut pages point to pages, that 
do not have current language version, so user jumps out to default language.

Example case:
- page "A" is configured as shortcut to first subpage, and is made both 
in default and alternative (L=1) language
- page "B" is first subpage of "A": and is made only in default language.
- page "C" is second subpage of "A": and is made in both languages.
- When using alternative language (L=1) and accessing page "A" typo3 
doesn't serve page "C" (in alt language) but page "B" (in default language)

Solution (applied by me to both 3.* and 4.* versions of typo3):
- open file /t3lib/class.t3lib_page.php
- find finction getMenu
- at the end of function body find:
                 if (is_array($row)) {
                     $output[$origUid] = $this->getPageOverlay($row);
                 }
- replace it with:
                 if (is_array($row)) {
                     $overlay=$this->getPageOverlay($row);
                     if($this->sys_language_uid){
                         if($row!=$overlay)$output[$row["uid"]]=$overlay;
                     }else{
                         $output[$row["uid"]]=$overlay;
                     }
                 }

I suggest to change it in next version of typo

-- 
Adam Nojszewski                           gg:9130731 skype:anojszewski
----------------------------------------------------------------------
http://favicon.pl/              http://www.linkedin.com/in/anojszewski




More information about the TYPO3-dev mailing list