Search code examples
typo3typo3-9.x

error in route enhancers since TYPO3 9.5.18


until TYPO3 9.5.17 the following route enhancer worked:

keywords:
  limitToPages:
    - 3735
  type: Plugin
  routePath: '/{uid}'
  namespace: tx_plkeywords_pi1
  requirements:
    uid: '[0-9]{1,3}'
  aspects:
    uid:
      type: PersistedAliasMapper
      tableName: tx_plkeywords_keywords
      routeFieldName: slug

The URL looks like this:

https://mydomain.de/mypage/?tx_plkeywords_pi1%5Buid%5D=376&cHash=385abdf54fe3c2617c617af32e5a5c1c

The error message:

Parameter "tx_plkeywords_pi1__uid" for route "enhancer_tx_plkeywords_pi1000000002142b4310000000022f8b3c9" must match "[0-9]{1,3}" ("videomarketing" given) to generate a corresponding URL.

The table exists and the entry with uid 376 has in the slugs field the entry "videomarketing". I don`t understand what is wrong with this code.

Any help appreciated ... ! Peter


Solution

  • You are checking the slug field routeFieldName: slug, where "videomarketing" is coming from. On the other hand you restrict the slug to be numeric with [0-9]{1,3}.

    The question is, what do you want in your slug?

    1. If you want the UID to be displayed, you don't need the aspects part as the UID is still given in the URL.
    2. If you want to use the slug, you need to remove the requirements from uid. Maybe you should rename the variable to maybe "keyword" as "uid" is misleading.