Bug #45254
closedIn TMENU the node is still a IFSUB when it only has subpages, which are excluded with excludeUidList
100%
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
Updated by Thorsten Kahler almost 12 years ago
- File issue_45254_v1.patch issue_45254_v1.patch added
- Status changed from New to Accepted
- % Done changed from 100 to 20
Seems valid by looking at the code.
Updated by Frederik Vosberg almost 12 years ago
Have I to commit this to gerrit? Sorry I am new to this.
Updated by Thorsten Kahler almost 12 years ago
- Assignee set to Thorsten Kahler
No, adding a patch here is absolutely sufficient, though using the unified format (diff -u
) helps identifying the changes.
Updated by Gerrit Code Review almost 12 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18214
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/18214
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/18214
Updated by Chris topher almost 12 years ago
- Subject changed from In TMENU the node is still a IFSUB when it has a dont respected childpage. to In TMENU the node is still a IFSUB when it only has subpages, which are excluded with excludeUidList
Updated by Jigal van Hemert over 11 years ago
Doubt a bit if this should go to earlier branches. Although it fixes a bug the menu rendering in existing sites could be changed because of this patch. I'll ask the RMs for their opinions.
Updated by Ernesto Baschny over 11 years ago
Usually I would say "don't need such a fix in 4.5" because of the late state we have are in the LTS - it's usually not worth the hassle.
On the other hand, it only changes the state of the rendered menus, not the content of the menus themselves. So where we once had a visual hint of "sub pages" with the fix it will be gone (which is a good thing).
So +1 if anyone is willing to backport that for 4.5 (and then probably then also in later still supported versions).
Updated by Frederik Vosberg over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 20 to 100
Applied in changeset 0212a64015772b4636512377bd645093e33894f7.
Updated by Gerrit Code Review over 11 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/20037
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/20038
Updated by Jigal van Hemert over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset 3a50bc7b435c8a3df3cda0e950fa63ba48838a6e.
Updated by Gerrit Code Review over 11 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/20039
Updated by Jigal van Hemert over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset ebf5c2a6a91653531a2d7ab8551830fcdc12677c.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed