Project

General

Profile

Actions

Bug #59225

open

Disabled Pages from Type Mount Point are still visible in Frontend

Added by Alex Kellner almost 10 years ago. Updated 17 days ago.

Status:
New
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2014-05-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

System TYPO3 4.7.17

Scenario: Adding a Page of type "Mount Point" with a page from tree 1 in tree 2.

I want to have a new menu item "test" in my second tree.
Related page "News" should be shown. That works fine.

But even if I disable the Mount Point - it's possible to open the link
in frontend. I have to delete the mount point to disable the functionality.

Actions #1

Updated by Mathias Schreiber over 8 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Mathias Schreiber

Yo Alex,

I need to know if I got that right:
You set the MountPoint to hidden but it will still show the target of the mountpoint.
Is that correct?

Actions #2

Updated by Mathias Schreiber over 8 years ago

  • Category set to Frontend
Actions #3

Updated by Alex Kellner over 8 years ago

That's correct.
Because of the long time ago, I'm not sure if I was logged out from backend - but I think I tested it in a second browser - the link was still working in Frontend.

Actions #4

Updated by Mathias Schreiber over 8 years ago

  • Status changed from Needs Feedback to Closed

Tested, cannot reproduce :)

Actions #5

Updated by Christian Weiske 4 months ago

I can reproduce it on TYPO3 v12.4.9.
The mount point has mount_pid_ol=1 set.
Disabling the mount point page (hidden=1) still makes it accessible in the frontend. It does not appear in menus, though.

Steps to reproduce:
1. Create normal visible page
2. Create page of type "mount point", configure mount_pid_ol=1, hidden=0 and mount_pid to the ID of the first page
3. View mount point page, it shows the contents of the first page.
4. Disable mount point
5. View mount point page, it still shows the contents of the first page.

Actions #6

Updated by Stefan Bürk 4 months ago

  • Status changed from Closed to New
Actions #7

Updated by Christian Weiske 17 days ago

  • TYPO3 Version changed from 4.7 to 12

When using a route path like /mp-test, the "hidden" property of the mount point page is not used and delivers a 200 OK .
When passing the page ID via GET parameter in the URL (/mp-test?id=23), the "hidden" property is used and a 404 "page not found" is returned.

This is because the core PageRouter resolves the page ID from the URL path and already handles mount points, and returns the mount point destination page UID.

When manually passing in the ID via ?id= GET parameter, the page router does not resolve the mount point target and passes the ID to TypoScriptFrontendController. There the hidden property of the mount point page is checked before the target page is resolved.


This is on TYPO3 12.4.14.

Actions #8

Updated by Christian Weiske 17 days ago

Workaround: Register a listener for AfterPageWithRootLineIsResolvedEvent event:

<?php

namespace Mogic\Dbi\Frontend\EventListener;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Controller\ErrorController;
use TYPO3\CMS\Frontend\Event\AfterPageWithRootLineIsResolvedEvent;

/**
 * Send a 404 when the source mount point page is hidden.
 * Workaround for TYPO3 bug #59225.
 *
 * @link https://forge.typo3.org/issues/59225
 */
class HiddenMountPointEventListener
{
    public function __invoke(AfterPageWithRootLineIsResolvedEvent $event): void
    {
        $params = $event->getRequest()->getQueryParams();
        if (!isset($params['MP'])) {
            //not a mount point page
            return;
        }

        list($targetUid, $mountPointUid) = explode('-', $params['MP']);

        $tsfe = $event->getController();
        $page = $tsfe->sys_page->getPage($mountPointUid);
        if (!empty($page)) {
            //mount point source page is available
            return;
        }

        $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
            $event->getRequest(),
            'The requested page does not exist!',
            [
                'hidden' => [
                    $mountPointUid => true
                ]
            ]
        );
        $event->setResponse($response);
    }
}
Actions

Also available in: Atom PDF