Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RouteEnhancer showing unwanted parameter #2372

Closed
kj-coupling opened this issue Mar 26, 2024 · 5 comments
Closed

RouteEnhancer showing unwanted parameter #2372

kj-coupling opened this issue Mar 26, 2024 · 5 comments

Comments

@kj-coupling
Copy link

Bug Report

Current Behavior
I'm not really sure if this problem is actualy a bug or missconfiguration. I've installed the news extension as always and wrote some lines for routeEnhancer. It worked on all my other TYPO3 installation but all of the sudden it doesnt.

Expected behavior/output
I want the route to be /list-view/detail-view/news-title. Its working fine, but after the "news-title" the URL continues with this parameters:
{news-titel}tx_news_pi1%5Bday%5D=26&tx_news_pi1%5Bmonth%5D=3&tx_news_pi1%5Byear%5D=2024&cHash=79da57fe3879139b3f9347b045910432

Am I missing something? I've tried some alternatives but still the same. List/Detail and Title working fine but month,day,year and chash still there. Is there something i need to considert in this version on TYPO3 and news.

routeEnhancer:
NewsPlugin:
type: Extbase
extension: News
plugin: Pi1
routes:
- routePath: '/{news_title}'
_controller: 'News::detail'
_arguments:
news_title: news
- routePath: '/category/{category_title}'
_controller: 'News::list'
_arguments:
category_title: overwriteDemand/categories
- routePath: '/'
_controller: 'News::list'
defaultController: 'News::list'
aspects:
news_title:
type: PersistedAliasMapper
tableName: 'tx_news_domain_model_news'
routeFieldName: 'path_segment'
category_title:
type: PersistedAliasMapper
tableName: 'sys_category'
routeFieldName: 'path_segment'

requirements:
  news_title: '^[a-zA-Z0-9].*$'
  category_title: '^[a-zA-Z0-9].*$'

Environment

  • TYPO3 version: 12.4.13
  • news version: 11.4.1
  • Is your TYPO3 installation set up with Composer (Composer Mode): no
  • OS: Win10

Thank you all in advance.

@froemken
Copy link
Contributor

froemken commented May 4, 2024

Hello @kj-coupling

Please use routeEnhancers with s as last letter and the world keeps turning again ;-)

From my side this ticket is solved

@kj-coupling
Copy link
Author

Hallo @froemken

I've noticed this mistake a while ago :)

`routeEnhancers:
NewsPlugin:
type: Extbase
extension: News
plugin: Pi1
routes:
- routePath: '/{news_title}'
_controller: 'News::detail'
_arguments:
news_title: news
- routePath: '/category/{category_title}'
_controller: 'News::list'
_arguments:
category_title: overwriteDemand/categories
- routePath: '/'
_controller: 'News::list'
defaultController: 'News::list'
aspects:
news_title:
type: PersistedAliasMapper
tableName: 'tx_news_domain_model_news'
routeFieldName: 'path_segment'
category_title:
type: PersistedAliasMapper
tableName: 'sys_category'
routeFieldName: 'path_segment'

requirements:
  news_title: '^[a-zA-Z0-9].*$'
  category_title: '^[a-zA-Z0-9].*$'`

I've already tried different ways to configure this routeEnhancher..but still. I get the /currentPage/News-title corrent but after the title ?tx_news_pi1%5Bday%5D=18&tx_news_pi1%5Bmonth%5D=4&tx_news_pi1%5Byear%5D=2024&cHash=377f097992c57c789e6d8493741906ec.

@froemken
Copy link
Contributor

Hello @kj-coupling

please use three of these ticks ``` to format your multi-lined code. It's damn hard to read. Or use the code button here in editor.
You want to format the dates in uri? Please adapt your RouteEnhancer as decribed here:

https://docs.typo3.org/p/georgringer/news/11.4/en-us/Tutorials/BestPractice/Routing/Index.html#human-readable-dates

@kj-coupling
Copy link
Author

Hello @froemken ,

sorry for that.

I've tried your suggestion: https://docs.typo3.org/p/georgringer/news/11.4/en-us/Tutorials/BestPractice/Routing/Index.html#human-readable-dates

It works like expected in TYPO3 11.5 but not in TYPO2 12.4. I dont need this part of the URL at all
tx_news_pi1%5Bday%5D=18&tx_news_pi1%5Bmonth%5D=4&tx_news_pi1%5Byear%5D=2024&cHash=377f097992c57c789e6d8493741906ec.
I've rewrote the Enhancer in different ways, but still, page and title are changing, but the rest still the same.

Is there something to consider in TYPO3 12.4? I am not using any other Extension - its a fresh installed TYPO3.

thanks

@froemken
Copy link
Contributor

@kj-coupling

I have no clue what you're doing. The URL looks like an archive URL. Please try default news plugin with list/detail and default news template and keep archive settings disabled. Is the URL now correct?

Stefan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants