Project

General

Profile

Actions

Feature #90814

closed

Allow slash in routeFieldResult and routeFieldPattern to allow optional paths

Added by Patrick Crausaz about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-03-23
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.3
Tags:
routing, url, aspects
Complexity:
Sprint Focus:

Description

Trying to use a slash in routeFieldPattern and routeFieldResult results in a fatal error.
There seems to be no valid regex pattern possible to achieve a routeFieldResult containing a slash.

The goal is to not have the category path in the URL when the category parameter is not provided.
Expecting URLs like:
Both parameter set: /producer/producer-naame/category/category-name
Only producer parameter set: /producer/producer-naame
Only category parameter set: /category/category-name

SomePlugin:
    type: Plugin
    limitToPages: [95]
    routePath: "/{producer}{category}" 
    namespace: "tx_myext_pi1" 
    requirements:
      producer: "[0-9]" 
      category: "[0-9]" 
    aspects:
      producer:
        type: PersistedPatternMapper
        tableName: "tx_myext_producers" 
        routeFieldPattern: "producer/^(?P<slug>.+)$" 
        routeFieldResult: "producer/{slug}" 
      category:
        type: PersistedPatternMapper
        tableName: "tx_myext_cats" 
        routeFieldPattern: "category/^(?P<slug>.+)$" 
        routeFieldResult: "category/{slug}" 

Not sure if this is a bug or a missing feature.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #88291: Exception thrown if slash in route field of PersistedPatternMapper aspectClosed2019-05-07

Actions
Actions #1

Updated by Patrick Crausaz about 4 years ago

  • Related to Bug #88291: Exception thrown if slash in route field of PersistedPatternMapper aspect added
Actions #2

Updated by Patrick Crausaz about 4 years ago

  • Category set to Link Handling, Site Handling & Routing

This issue may be solved with Bug #88291 in version 9.5.15

Actions #3

Updated by Patrick Crausaz about 4 years ago

The patch of Bug #88291 solves this issue for me.
Can be closed

Actions #4

Updated by Susanne Moog about 4 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF