Project

General

Profile

Actions

Bug #45254

closed

In TMENU the node is still a IFSUB when it only has subpages, which are excluded with excludeUidList

Added by Frederik Vosberg almost 12 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Category:
Content Rendering
Target version:
Start date:
2013-02-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

When you have a menu, a page, which has only one subpage, which is excluded by excludeUidList, is still a IFSUB. Example:

The page with the id 2 has one subpage with the id 37.

lib.example = HMENU
lib.example.excludeUidList = 37

The page 2 is still a IFSUB page, while the page 2 has no subs in the frontend. It's a quite small bugfix:

In TYPO3 6.0.1 in the file typo3_src/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php in the method isSubMenu($uid) on line 1495:

public function isSubMenu($uid) { // Looking for a mount-pid for this UID since if that // exists we should look for a subpages THERE and not in the input $uid; $mount_info = $this->sys_page->getMountPointInfo($uid); if (is_array($mount_info)) { $uid = $mount_info['mount_pid']; } $recs = $this->sys_page->getMenu($uid, 'uid,pid,doktype,mount_pid,mount_pid_ol,nav_hide,shortcut,shortcut_mode,l18n_cfg'); $hasSubPages = FALSE; /* #### bugfix start ### */ $bannedUids = $this->getBannedUids(); /* #### bugfix end #### */ foreach ($recs as $theRec) { // no valid subpage if the document type is excluded from the menu if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->doktypeExcludeList, $theRec['doktype'])) { continue; } // No valid subpage if the page is hidden inside menus and // it wasn't forced to show such entries if ($theRec['nav_hide'] && !$this->conf['includeNotInMenu']) { continue; } // No valid subpage if the default language should be shown and the page settings // are excluding the visibility of the default language if (!$GLOBALS['TSFE']->sys_language_uid && \TYPO3\CMS\Core\Utility\GeneralUtility::hideIfDefaultLanguage($theRec['l18n_cfg'])) { continue; } // No valid subpage if the alternative language should be shown and the page settings // are requiring a valid overlay but it doesn't exists $hideIfNotTranslated = \TYPO3\CMS\Core\Utility\GeneralUtility::hideIfNotTranslated($theRec['l18n_cfg']); if ($GLOBALS['TSFE']->sys_language_uid && $hideIfNotTranslated && !$theRec['_PAGES_OVERLAY']) { continue; } /* ##### bugfix start ##### */ // No valid subpage if the subpage is banned by excludeUidList from being displayed if (in_array($theRec['uid'], $bannedUids)) { continue; } /* ##### bugfix end #### */ $hasSubPages = TRUE; break; } return $hasSubPages; }

The two places where I added code are commented with //added this. I hope this is right, its my first bugfix.


Files

AbstractMenuContentObject.bugfixed.php (72.6 KB) AbstractMenuContentObject.bugfixed.php Bugfixed version Frederik Vosberg, 2013-02-07 20:17
AbstractMenuContentObject.php (72.5 KB) AbstractMenuContentObject.php Not bugfixed for diff Frederik Vosberg, 2013-02-07 20:17
issue_45254_v1.patch (1.22 KB) issue_45254_v1.patch Patch derived from suggested solution Thorsten Kahler, 2013-02-08 10:13

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #47449: Incomplete mock raises PHP 5.4 warningClosed2013-04-22

Actions
Actions

Also available in: Atom PDF