#15984menu.showAccessRestrictedPages doesn't replace link for "include subpages"
Description
When creating a menu with showAccessRestrictedPages set to any PID, links to pages that inherit a usergroup restriction (“include subpages” set on a parent page) won’t be substituted.
function changeLinksForAccessRestrictedPages(..) @ class.tslib_menu.php is calling $GLOBALS[‘TSFE’]->checkPageGroupAccess($page) which itself does not traverse the pagetree to check if a parent page has the field “extendToSubpages” set true.
Same problem may occour when using config.typolinkLinkAccessRestrictedPages for typolinks, but I have not tried yet.
(issue imported from #M3129)
Reviews 3
- main 1186[BUGFIX] showAccessRestrictedPages doesn't replace links to restricted subpages
- TYPO3_4-5 2545[BUGFIX] showAccessRestrictedPages doesn't replace links to restricted subpages
- TYPO3_4-5 2544[BUGFIX] showAccessRestrictedPages doesn't replace links to restricted subpages
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[BUGFIX] menu.showAccessRestrictedPages doesn't replace link for "include subpages" Resolves: #15984 Releases: main
Related issues 4
Files 1
History 2023
-
Franz Koch commented <span data-processor="relativetime" data-value="2010-06-09T15:10:48+00:00" > 06/09/10, 15:10 </span>
Just stumbled over this bug in recent 4.4 SVN version.
-
Chris topher commented <span data-processor="relativetime" data-value="2010-06-09T20:14:59+00:00" > 06/09/10, 20:14 </span>
It would be great, if someone of you could provide a patch and send it to Core List:
-
Sven Teuber commented <span data-processor="relativetime" data-value="2010-06-10T16:46:11+00:00" > 06/10/10, 16:46 </span>
The problem occurs for config.typolinkLinkAccessRestrictedPages, too, see related ticket 0014690
-
Sven Teuber commented <span data-processor="relativetime" data-value="2010-06-10T22:47:35+00:00" > 06/10/10, 22:47 </span>
Provided patch, will send it to core list now
-
Mr. Hudson <span data-processor="relativetime" data-value="2011-04-10T12:19:56+00:00" > 04/10/11, 12:19 </span> Patch set 3 of change I98ea123ccdf1e370f28103546191b0a7234076f4 has been pushed to the review server. It is available at http://review.typo3.org/1186
-
Mr. Hudson <span data-processor="relativetime" data-value="2011-06-06T17:14:01+00:00" > 06/06/11, 17:14 </span> Patch set 1 of change I98ea123ccdf1e370f28103546191b0a7234076f4 has been pushed to the review server. It is available at http://review.typo3.org/2544
-
Mr. Hudson <span data-processor="relativetime" data-value="2011-06-06T17:17:34+00:00" > 06/06/11, 17:17 </span> Patch set 1 of change I459aa01a8aba89ce361accd3dd84ea0329c5d1e4 has been pushed to the review server. It is available at http://review.typo3.org/2545
-
Andreas Wolf commented and changed category target version TYPO3 Version
4.44.5 <span data-processor="relativetime" data-value="2011-06-06T17:18:48+00:00" > 06/06/11, 17:18 </span>Have merged this one for master, but I think we should also have it in 4.5.
-
Sven Teuber commented and changed status
AcceptedResolved done0 %100 % <span data-processor="relativetime" data-value="2011-06-06T17:30:32+00:00" > 06/06/11, 17:30 </span>Applied in changeset commit:94feeb2596244bc463afd428aab41353eb1740a4.
-
Markus Klein commented <span data-processor="relativetime" data-value="2011-10-06T01:13:23+00:00" > 10/06/11, 01:13 </span>
Patch for 4.5 is still pending, but has enough votes!
-
Xavier Perseguers changed status
ResolvedClosed <span data-processor="relativetime" data-value="2012-03-07T13:31:56+00:00" > 03/07/12, 13:31 </span> -
Susanne Moog commented and changed status
ClosedAccepted removed the assignee target version done100 %0 % Complexity hard <span data-processor="relativetime" data-value="2012-03-18T23:03:36+00:00" > 03/18/12, 23:03 </span>Reopened as we had to revert the patch because of the massive performance impact it had.
We need to find another solution that does not check the whole root line for each and every page again.
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2017-04-19T23:31:50+00:00" > 04/19/17, 23:31 </span>
I just wanted to be sure, but I tested it with 7.6 and I think it is still present.
My test:1) Very basic PageTree:
[1] Home | +-[8] Login | +- [5] Test 15984 | | | +- [6] Test 15984_subpage | + - [4] Sysfolder Users
2) Page [4] contains FE users and groups (a group named TEST and an user named test)
3) On page [8] there is a FELogin plugin with the following configuration:- User Storage Page: 4
- Redirect mode: After Login (TS+Flexform) + Defined by GET/POST parameters
- Use First Supported Mode from Selection: enabled4) Page [5] has been configured this way:
- Usergroup Access Rights: TEST
- Extend to subpages: enabled5) Very basic TS Setup:
config.no_cache=1 page = PAGE config.typolinkLinkAccessRestrictedPages = 8 config.typolinkLinkAccessRestrictedPages_addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID### page.5 = HMENU page.5.entryLevel=0 page.5.1 = TMENU page.5.1{ showAccessRestrictedPages = 8 showAccessRestrictedPages.addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID### wrap=<ul>|</ul> expAll=1 NO.wrapItemAndSub = <li>|</li> } page.5.2 < page.5.1 page.10 = TEXT page.10.data = page:title page.10.wrap = <h1>|</h1> page.100 < styles.content.getResults:
1) when rendering the menu, all pages are visible (8,5,6)
2) the link of page Test 15984 ishttp://typo3.7.test.it:8888/index.php?id=8&return_url=index.php%3Fid%3D5%26L%3D0&pageId=5
It lands on [8] and, after login, you get redirected again to [5]
3) the link of page [6] Test 15984_subpage is
http://typo3.7.test.it:8888/index.php?id=6and, if you try to access it while logged out, you get redirected to the home page (i.e. the first accessible page in the tree). after logged, the link works as expected and brings you to the [6] -
Riccardo De Contardi changed Related to #26484 <span data-processor="relativetime" data-value="2017-04-23T22:40:21+00:00" > 04/23/17, 22:40 </span>
-
Riccardo De Contardi changed Related to #78825 <span data-processor="relativetime" data-value="2017-04-23T22:40:30+00:00" > 04/23/17, 22:40 </span>
-
Riccardo De Contardi changed Related to #26484 <span data-processor="relativetime" data-value="2017-04-23T22:40:49+00:00" > 04/23/17, 22:40 </span>
-
Riccardo De Contardi changed
Related to #26484<span data-processor="relativetime" data-value="2017-04-23T22:40:59+00:00" > 04/23/17, 22:40 </span> -
Susanne Moog changed category <span data-processor="relativetime" data-value="2017-10-29T16:15:56+00:00" > 10/29/17, 16:15 </span>
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2020-03-23T22:04:13+00:00" > 03/23/20, 22:04 </span>
I’ve repeated my test on comment 15 on version 9.5.14
the difference is just the ID of the pages:
ID of login page = 230
ID of restricted page (and extend to subpages): 231
ID of subpage: 2321) when rendering the menu, all pages are visible
2) the link of page [231] test15984 ishttps://typo3.9.test.it:8890/login?pageId=231&return_url=%2Ftest15984&cHash=a0ecef2c1a6ea8753930b425932f95f4
clicking on it you land on the login page (230) and after that, you are redirected again to ID=231
please note that the link is not beautified.
3) the link on the page 232 is
https://typo3.9.test.it:8890/supertest15984/test15984-subpage3.1 Access it while not logged in: Page not found error is shown with the message:
Page Not Found Reason: Subsection was found and not accessible
3.2 Access it after logged in: works like a normal link
I repeated the same test on latest master (10.4.0-dev) and the results are the same except
1) the redirection does not seem to work
2) the message for the page not found is slightly different:Page Not Found The page did not exist or was inaccessible. Reason: Subsection was found and not accessible
-
Benni Mack changed Sprint Focus Stabilization Sprint <span data-processor="relativetime" data-value="2023-06-06T13:04:01+00:00" > 06/06/23, 13:04 </span>
-
Matthias Kappenberg commented and changed TYPO3 Version
4.513 PHP Version5.38.3 <span data-processor="relativetime" data-value="2026-04-15T09:44:14+00:00" > 04/15/26, 09:44 </span>It seems, that it is not solved.
In my opinion a must-have.
Additionally, we ran into PHP timeouts on pages with a link to a restricted page,
while having this setup (as mentioned above):config.typolinkLinkAccessRestrictedPages... ...
This Problem still exists in TYPO3 4.2.X and 4.3.X!
tslib_fe.checkPageGroupAccess() does not work with “extendToSubpages”.
Page 1 (restricted and extendToSubpages checked)
– Page 2 (not directly restricted but should be restricted because of “extendToSubpages” of Page 1)
$GLOBALS[‘TSFE’]->checkPageGroupAccess(2) returns true because it does not check the page tree.