Project

General

Profile

Actions

Bug #87763

closed

Duplicate VariableName in routeEnhancer

Added by Stefan Froemken over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Start date:
2019-02-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hello Core-Team,

I'm just trying to get my URLs for events2 working again. Here is my configuration:

routeEnhancers:
  Events2ShowPlugin:
    type: Extbase
    extension: Events2
    plugin: Events
    routes:
      -
        routePath: '/show/{date}/{time}/{event_title}'
        _controller: 'Day::show'
        _arguments:
          date: timestamp
          time: timestamp
          event_title: event
    requirements:
      date: '\d+'
      event_title: '^[a-zA-Z0-9]+\-[0-9]+$'
    defaultController: 'Day::show'
    aspects:
      date:
        type: TimestampMapper
        format: 'Y-m-d'
      time:
        type: TimestampMapper
        format: 'Hi'
      event_title:
        type: PersistedPatternMapper
        tableName: 'tx_events2_domain_model_event'
        routeFieldPattern: '^(?P<title>.+)-(?P<uid>\d+)$'
        routeFieldResult: '{title}-{uid}'

I get the error message:
Route pattern "/extensions/events2/show/{tx_events2_events__timestamp}/{tx_events2_events__timestamp}/{tx_events2_events__event}" cannot reference variable name "tx_events2_events__timestamp" more than once.

That does not make sense as I have given them the name <date> and <time>. Is there a possibility to use my namings for these variables? Or you can number these Variables like in Doctrine :

/extensions/events2/show/{tx_events2_events__timestamp-0}/{tx_events2_events__timestamp-1}/{tx_events2_events__event-2}

Stefan

Actions #1

Updated by Benni Mack over 5 years ago

  • Status changed from New to Needs Feedback

Hey Stefan,

looks like you want to have to URL parts (slugs) being merged together into one variable? Is that right?

Actions #2

Updated by Stefan Froemken over 5 years ago

Hi Benni,

I don't know if I understand you correct, because I want to use one GET-Parameter multiple times in my configuration. So I don't understand your "being merged together".
I have a timestamp as GET-Parameter and that should be converted to .../2019-05-24/1324/...
But maybe you see it from the other point of view: Yes, .../2019-05-24/1324/... should be merged into ONE GET-Parameter (timestamp)

Stefan

Actions #3

Updated by Benni Mack over 5 years ago

  • Target version changed from next-patchlevel to Candidate for patchlevel
Actions #4

Updated by Benni Mack over 4 years ago

  • Status changed from Needs Feedback to Closed

Hey Stefan,

as chatted in Slack, this is the solution for your problem - a custom Aspect.

https://github.com/jweiland-net/events2/blob/master/Classes/Routing/Aspect/TimestampMapper.php

Actions

Also available in: Atom PDF