Project

General

Profile

Actions

Bug #82036

closed

Missing use of pageNotFound_handling in TypoScriptFrontendController.php, only PageNotFoundException is used.

Added by Jan Bartnik over 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2017-08-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Use of pageNotFound_handling is not implemented for cases:
"Mount point" page mounting nonaccessible page (line 1622) and
"Shorcut" page redirecting to nonaccessible page (lines 1708, 1716, 1723) - TYPO3 7.6.21

For this cases, TYPO3 allways run PageNotFoundException and when pageNotFound_handling is set, then site visitors could see 2 kinds of error pages: configured one and TYPO3's default error page. I think it is a bug.


Files

TypoScriptFrontendController.php.diff (1020 Bytes) TypoScriptFrontendController.php.diff simple diff file Jan Bartnik, 2017-08-04 01:17

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #80813: incorrect pageNotFound_handling behaviourClosedHenrik Elsner2017-04-11

Actions
Related to TYPO3 Core - Bug #86346: Hidden pages sent 403 HeaderClosed2018-09-21

Actions
Actions #1

Updated by Riccardo De Contardi about 6 years ago

I performed a little test with 8.7 and I think that this error is still present.

my test:

1) Install tool > [FE][pageNotFound_handling] > set a static (existing) page:

[FE][pageNotFound_handling] = http://typo3.8.test.it/fileadmin/error.html

2) On frontend, if you try to access a non existent page (e.g. http://typo3.8.test.it/index.php?id=234111, you will see the error.html file

3) create a page (e.g. with id=48) and hide it
4) create a page e.g. with id=49 > make it visible, make it of . type=shortcut and point the shortcut to the page created at point 3
5) On frontend, if you try to access it: http://typo3.8.test.it/index.php?id=49 you will see the standard TYPO3 error page:

Page Not Found (404)
This page (ID 49) is of type "Shortcut" and configured to redirect to a subpage. However, this page has no accessible subpages.
More information regarding this error might be available online.
Actions #2

Updated by Riccardo De Contardi about 6 years ago

  • Related to Bug #80813: incorrect pageNotFound_handling behaviour added
Actions #3

Updated by Benni Mack over 5 years ago

  • Status changed from New to Needs Feedback

Hey all,

IMHO this is fixed with TYPO3 v9 and site handling. Can somebody verify if TYPO3 v9 solves this issue?

Thanks.
Benni.

Actions #4

Updated by Riccardo De Contardi over 5 years ago

@Benni Mack, I tried the following test with the latest master:

1) create a very basic 404.html file inside /fileadmin/:

<!DOCTYPE html>
<html>
<head>
    <title>404 page</title>
    <style type="text/css">
        body{
            background: #d00;
            color:#fff;
        }
    </style>
</head>
<body>
<h1>This is a static 404 Page!!!</h1>
</body>
</html>

2) Site configuration > create a configuration for error handling

- errorCode: 404
- errorHandler: fluidtemplate
- errorFluidTemplate: fileadmin/404.html

the relevant part in the yaml file so it is:

errorHandling:
  -
    errorCode: '404'
    errorHandler: Fluid
    errorFluidTemplate: fileadmin/404.html
    errorFluidTemplatesRootPath: ''
    errorFluidLayoutsRootPath: ''
    errorFluidPartialsRootPath: ''

3) Try to access a non existent page: https://mysite.com/non-esistent-page

Results: the 404.html page is shown (OK)

4) create a page (e.g. with id=60) and hide it
5) create a page e.g. with id=61 > make it visible, make it of type=shortcut and point the shortcut to the page created at point 4

Results: On frontend, if you try to access it: https://mysite.com/page-that-points-to-hidden-page you will see the following TYPO3 error page:

Page Not Found
Reason: ID was not an accessible page
Actions #5

Updated by Benni Mack over 5 years ago

hey Riccardo,

this case is handled by "403" (access denied), can you check if this works?

errorHandling:
  -
    errorCode: '403'
    errorHandler: Fluid
    errorFluidTemplate: fileadmin/404.html
    errorFluidTemplatesRootPath: ''
    errorFluidLayoutsRootPath: ''
    errorFluidPartialsRootPath: ''
Actions #6

Updated by Riccardo De Contardi over 5 years ago

@Benni Mack, I performed a more detailed test on 9.5.5

Test setup

1) Create a page (Uid=51) called "404 error page"
2) Create a page (Uid=52) called "403 error page"
3) Create a file fileadmin/404.html
4) Create a file fileadmin/403.html
5) Create a page "hidden page" (hidden)
6) Create a page "red to hidden page" (shortcut to the page created at point 5, visible)

The following Url will be tested

the test is done with a separate browser window (in incognito mode)

a) call a non-existent page https://test.it/silly-page
b) call the hidden page https://test.it/hidden-page
c) call the page that redirects to the hidden page https://red-to-hidden-page

Test conditions

On Site Configuration > Error Handling, I created both configurations for 404 error and 403 error

a) First, I set both as "Show content from page" pointing to the pages created at point 1 and 2
b) Then I set both as "Fluid Template" pointing to the files created at point 3 and 4

Test results

Site config: Show content from page Site Config: Fluid Template Status code
call non-existent page https://test.it/silly-page 404 error page (Uid=51) shown 404.html shown 404 The requested page does not exist
call hidden page https://test.it/hidden-page 403 error page (Uid=52) shown 403.html shown 403 ID was not an accessible page
call the page that redirects to the hidden page https://red-to-hidden-page 403 error page (Uid=52) shown 403.html shown 403 ID was not an accessible page

Side note

I also experimented the following behavior: if you preview the urls in the same browser where you're logged in TYPO3 CMS

- if you call https://test.it/hidden-page, then you will se a preview of the page (with the "Preview" box)
- if you call https://red-to-hidden-page you get the 403 error page / error html file

Actions #7

Updated by Susanne Moog over 4 years ago

  • Related to Bug #86346: Hidden pages sent 403 Header added
Actions #8

Updated by Susanne Moog over 4 years ago

  • Status changed from Needs Feedback to Closed

The only thing left in this issue is the distinction between 404 and 403 cases for things like hidden. This is also reported and discussed in #86346 - so I'm going to close this issue here and we can continue in #86346.

Actions

Also available in: Atom PDF