Bug #88291

Exception thrown if slash in route field of PersistedPatternMapper aspect

Added by Daniel Reichel over 1 year ago. Updated 7 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-05-07
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In my site configuration I have configured a aspect of type PersistedPatternMapper for the detail view of a record of my custom extension.
If the configured route field contains a slash, a error occurs in the frontend.

Exception thrown in frontend

You can reproduce the bug using the news extension. I know, the news extension has a slug field but my custom extension which you dont't have has not.
This is the site configuration:

routeEnhancers:
  NewsPlugin:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
      - { routePath: '/news/{news}', _controller: 'News::detail', _arguments: {'news': 'news_title'} }
    defaultController: 'News::detail'
    aspects:
      news:
        type: PersistedPatternMapper
        tableName: 'tx_news_domain_model_news'
        routeFieldPattern: '^(?P<title>.+)-(?P<uid>\d+)$'
        routeFieldResult: '{title}-{uid}'

exception.jpg View - Exception thrown in frontend (137 KB) Daniel Reichel, 2019-05-07 13:40


Related issues

Related to TYPO3 Core - Bug #86596: Slash in Page Title still in URL Closed 2018-10-08
Related to TYPO3 Core - Bug #87667: Replacements not applied for existing slug Needs Feedback 2019-02-06
Related to TYPO3 Core - Bug #87656: Slugs error if title has "/" in extbase extension Closed 2019-02-05
Related to TYPO3 Core - Bug #87333: Slug fieldSeparator default value collides with symfony strict requirements Closed 2019-01-05
Related to TYPO3 Core - Bug #89263: TCEMAIN.preview doesn't work for routed controller with empty arguments New 2019-09-25
Related to TYPO3 Core - Bug #90531: Requirements are not considered when an aspect is present Closed 2020-02-25
Related to TYPO3 Core - Feature #90814: Allow slash in routeFieldResult and routeFieldPattern to allow optional paths Closed 2020-03-23

Associated revisions

Revision 1ee7266e (diff)
Added by Christian Eßl 8 months ago

[BUGFIX] Allow slashes in enhanced routes having aspects definitions

The changes made in #86895 broke previous behaviour in page routing by
disallowing the use of the "requirements" option for a route when
aspects are present - "aspects now take precedence over requirements".

While the reasoning behind this change is valid, the requirements in
the Symfony Routing package would now always default to '[^/]++'
(every character except "/") for routes that use aspects.

Before, it was possible to manually set the requirements to '.+' to
allow slashes in an argument value.

Instead of purging requirements for variable names having an aspect
definition as well, thoese requirements are set to `.+` to relax the
default Symfony constraints on default delimiter `/` in this case.

Resolves: #90531
Resolves: #88291
Resolves: #87333
Related: #86895
Releases: master, 9.5
Change-Id: I27076aa0425d050e729db84d8e3461a329321342
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63529
Tested-by: Oliver Hader <>
Tested-by: TYPO3com <>
Tested-by: Christian Eßl <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Hader <>
Reviewed-by: Christian Eßl <>
Reviewed-by: Benni Mack <>

Revision e98ba4a4 (diff)
Added by Christian Eßl 8 months ago

[BUGFIX] Allow slashes in enhanced routes having aspects definitions

The changes made in #86895 broke previous behaviour in page routing by
disallowing the use of the "requirements" option for a route when
aspects are present - "aspects now take precedence over requirements".

While the reasoning behind this change is valid, the requirements in
the Symfony Routing package would now always default to '[^/]++'
(every character except "/") for routes that use aspects.

Before, it was possible to manually set the requirements to '.+' to
allow slashes in an argument value.

Instead of purging requirements for variable names having an aspect
definition as well, thoese requirements are set to `.+` to relax the
default Symfony constraints on default delimiter `/` in this case.

Resolves: #90531
Resolves: #88291
Resolves: #87333
Related: #86895
Releases: master, 9.5
Change-Id: I27076aa0425d050e729db84d8e3461a329321342
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63655
Reviewed-by: Oliver Hader <>
Reviewed-by: Benni Mack <>
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>

History

#1 Updated by Daniel Reichel over 1 year ago

  • Related to Bug #86596: Slash in Page Title still in URL added

#2 Updated by Daniel Reichel over 1 year ago

  • Related to Bug #87667: Replacements not applied for existing slug added

#3 Updated by Daniel Reichel over 1 year ago

  • Related to Bug #87656: Slugs error if title has "/" in extbase extension added

#4 Updated by Bastian Bringenberg over 1 year ago

  • Project changed from forge.typo3.org to TYPO3 Core
  • TYPO3 Version set to 9

Moved Project.

#5 Updated by Riccardo De Contardi over 1 year ago

  • Category set to Link Handling, Site Handling & Routing

#6 Updated by Christian Eßl 8 months ago

  • Related to Bug #87333: Slug fieldSeparator default value collides with symfony strict requirements added

#7 Updated by Christian Eßl 8 months ago

  • Related to Bug #89263: TCEMAIN.preview doesn't work for routed controller with empty arguments added

#8 Updated by Christian Eßl 8 months ago

  • Related to Bug #90531: Requirements are not considered when an aspect is present added

#9 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/+/63529

#10 Updated by Gerrit Code Review 8 months ago

Patch set 2 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/+/63529

#11 Updated by Gerrit Code Review 8 months ago

Patch set 3 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/+/63529

#12 Updated by Gerrit Code Review 8 months ago

Patch set 4 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/+/63529

#13 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/+/63655

#14 Updated by Christian Eßl 8 months ago

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

#15 Updated by Patrick Crausaz 7 months ago

  • Related to Feature #90814: Allow slash in routeFieldResult and routeFieldPattern to allow optional paths added

#16 Updated by Benni Mack 7 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF