[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>
Mon, 6 Jun 2011 15:10:28 +0000 (17:10 +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: I98ea123ccdf1e370f28103546191b0a7234076f4
Resolves: #15984
Reviewed-on: http://review.typo3.org/1186
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Christian Mueller
Reviewed-by: Georg Ringer
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
typo3/sysext/cms/tslib/class.tslib_fe.php

index 6b85508..57dc4da 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;
        }