Issue Bug Accepted Orphaned

#15984menu.showAccessRestrictedPages doesn't replace link for "include subpages"

Wolfgang Sassik 04/05/06, 03:07 updated 04/15/26, 09:44

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

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

Files 1

History 2023

  1. Sascha Egerer commented <span data-processor="relativetime" data-value="2010-01-14T09:44:45+00:00" > 01/14/10, 09:44 </span>

    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.

  2. 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.

  3. 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:

    http://typo3.org/teams/core/core-mailinglist-rules/

  4. 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

    http://bugs.typo3.org/view.php?id=14690

  5. 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

  6. 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

  7. 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

  8. 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

  9. Andreas Wolf commented and changed category target version TYPO3 Version 4.4 4.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.

  10. Sven Teuber commented and changed status Accepted Resolved done 0 % 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.

  11. Susanne Moog commented and changed status Closed Accepted removed the assignee target version done 100 % 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.

  12. 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: enabled

    4) Page [5] has been configured this way:

    - Usergroup Access Rights: TEST
    - Extend to subpages: enabled

    5) 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.get

    Results:

    1) when rendering the menu, all pages are visible (8,5,6)
    2) the link of page Test 15984 is

    http://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=6 and, 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]

  13. 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: 232

    1) when rendering the menu, all pages are visible
    2) the link of page [231] test15984 is

    https://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-subpage

    3.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
  14. Matthias Kappenberg commented and changed TYPO3 Version 4.5 13 PHP Version 5.3 8.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...
    ...