Task #88133

Required code change in PageRouter

Added by Dmitry Dulepov 8 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-04-10
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
no-brainer
Sprint Focus:

Description

In TYPO3\CMS\Core\Routing\PageRouter:

    public function matchRequest(ServerRequestInterface $request, RouteResultInterface $previousResult = null): RouteResultInterface
    {
        $urlPath = $previousResult->getTail();

According to Benni != null should be removed.

Links:

Associated revisions

Revision 0480e384 (diff)
Added by Benni Mack 8 months ago

[BUGFIX] Ensure PageRouter only operates with previous result

If no previous result given, an exception should be thrown,
instead of a PHP error.

Resolves: #88133
Releases: master, 9.5
Change-Id: I708e735e664589b0fc8d125a60b9970128b584af
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60474
Tested-by: TYPO3com <>
Tested-by: Dmitry Dulepov
Tested-by: Susanne Moog <>
Reviewed-by: Dmitry Dulepov
Reviewed-by: Susanne Moog <>

Revision f0239a42 (diff)
Added by Benni Mack 8 months ago

[BUGFIX] Ensure PageRouter only operates with previous result

If no previous result given, an exception should be thrown,
instead of a PHP error.

Resolves: #88133
Releases: master, 9.5
Change-Id: I708e735e664589b0fc8d125a60b9970128b584af
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60489
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>

History

#1 Updated by Benni Mack 8 months ago

Thanks for opening this ticket.

However, I found out that the RouterInterface uses the same logic, so we'd need the interface to change as well.

The original idea was to use the same Interface for SiteMatcher as well, however, I never went through with this.

So we have two options:
a) Make the change and also the interface, making it kind of breaking.
b) catch the null issue in PageRouter to make an early return, make the Interface Change in v10 only

What do you think?

#2 Updated by Dmitry Dulepov 8 months ago

Option "b" would be sufficient solution and also no brainer.

However I do not think that interface should change because I think I saw a place where another router is called without a second argument. I can be mistaken about this but I think there was something like this in the code.

#3 Updated by Gerrit Code Review 8 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60474

#4 Updated by Gerrit Code Review 8 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60489

#5 Updated by Gerrit Code Review 8 months ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60489

#6 Updated by Benni Mack 8 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Benni Mack 7 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF