[BUGFIX] showAccessRestrictedPages doesn't replace links to restricted subpages
authorSven Teuber <teuber@stibes.de>
Thu, 17 Mar 2011 10:25:28 +0000 (11:25 +0100)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Wed, 26 Oct 2011 14:04:45 +0000 (16:04 +0200)
When creating a menu with showAccessRestrictedPages set to any PID, links to pages
that inherit an access restriction ("include subpages" set on a parent page)
won't be substituted.

Change-Id: I459aa01a8aba89ce361accd3dd84ea0329c5d1e4
Resolves: #15984
Reviewed-on: http://review.typo3.org/2545
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Stefan Neufeind
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
typo3/sysext/cms/tslib/class.tslib_fe.php

index bb2bc68..48da79d 100644 (file)
                if(!is_array($groupList)) {
                        $groupList = explode(',', $groupList);
                }
+
+                       // If the actual page has no fe_group, check the rootline for
+                       // inherited fe_group due to extendToSubpage-property
+               if (intval($row['fe_group']) === 0) {
+                       $rootLine = $this->sys_page->getRootLine($row['uid']);
+                       foreach ($rootLine as $pageConf) {
+                               if ($pageConf['fe_group'] != '' && $pageConf['extendToSubpages'] == 1) {
+                                       $row['fe_group'] = $pageConf['fe_group'];
+                                       break;
+                               }
+                       }
+               }
+
                $pageGroupList = explode(',', $row['fe_group'] ? $row['fe_group'] : 0);
                return count(array_intersect($groupList, $pageGroupList)) > 0;
        }