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

routeEnhancers with overwriteDemand/* not working in 12 #2146

Open
trokohl opened this issue Jul 12, 2023 · 6 comments
Open

routeEnhancers with overwriteDemand/* not working in 12 #2146

trokohl opened this issue Jul 12, 2023 · 6 comments

Comments

@trokohl
Copy link

trokohl commented Jul 12, 2023

Bug Report

I am not sure if it is a news or Typo3 bug. But since Typo 12 the mapping of the overwriteDemand parameters in combination with the NewsCategoryMapper or PersistedAliasMapper doesn't seem to work anymore.

Current Behavior
A call from
news/testcat

returns no results but a call with:

news/?tx_news_pi1[overwriteDemand][categories]=1&cHash=0e70fa1f6a2ce75e2db9713a4ddb5aeb

returns results.
The array overwriteDemand always arrives in the controller with null in the first case.

Environment

  • TYPO3 version(s): 12.4.x
  • news version: 11.1.1
  • Is your TYPO3 installation set up with Composer (Composer Mode): yes

routeEnhancers:
  News:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
      - routePath: '/'
        _controller: 'News::list'
      - routePath: '/page-{page}'
        _controller: 'News::list'
        _arguments:
          page: 'currentPage'
      - routePath: '/{news-title}'
        _controller: 'News::detail'
        _arguments:
          news-title: news
      - routePath: '/{category-name}'
        _controller: 'News::list'
        _arguments:
          category-name: overwriteDemand/categories
      - routePath: '/{tag-name}'
        _controller: 'News::list'
        _arguments:
          tag-name: overwriteDemand/tags
    defaultController: 'News::list'
    defaults:
      page: '0'
    aspects:
      news-title:
        type: NewsTitle
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'
      category-name:
        type: NewsCategory
      tag-name:
        type: NewsTag
  PageTypeSuffix:
    type: PageType
    map:
      'feed.xml': 9818
      'calendar.ical': 9819
@web2date
Copy link

Hi Georg, I can confirm that bug too in TYPO3v11 / news v 11.1.2 when overwriting stickylist via DateMenu. Kind regards Andrea

@georgringer
Copy link
Owner

tested this with simple

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: ''
    map:
      feed.xml: 9818
      calendar.ical: 9819
  News:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
      - routePath: '/'
        _controller: 'News::list'
      - routePath: '/category/{category-name}'
        _controller: 'News::list'
        _arguments:
          category-name: overwriteDemand/categories
      - routePath: '/tag/{tag-name}'
        _controller: 'News::list'
        _arguments:
          tag-name: overwriteDemand/tags
    defaultController: 'News::list'
    defaults:
      page: '0'
    aspects:
      category-name:
        type: PersistedAliasMapper
        tableName: sys_category
        routeFieldName: slug

and looks good - imho the issue must be in core or ordering of routing :/

@web2date
Copy link

web2date commented Aug 7, 2023

Hi, I have this in my config.yaml

routeEnhancers:
  News:
    type: Extbase
    limitToPages: [14,18,19]
    extension: News
    plugin: Pi1
    routes:
      -
        routePath: /
        _controller: 'News::list'
      -
        routePath: '/{page-label}-{page}'
        _controller: 'News::list'
        _arguments:
          page: currentPage
      -
        routePath: '/{news-title}'
        _controller: 'News::detail'
        _arguments:
          news-title: news
      # Date year:
      - routePath: '/{date-year}'
        _controller: 'News::list'
        _arguments:
          date-month: 'overwriteDemand/month'
          date-year: 'overwriteDemand/year'
          page: 'currentPage'
      # Date year + pagination:
      - routePath: '/{date-year}/{page-label}-{page}'
        _controller: 'News::list'
        _arguments:
          date-year: 'overwriteDemand/year'
          page: 'currentPage'
      # Date year/month:
      - routePath: '/{date-year}/{date-month}'
        _controller: 'News::list'
        _arguments:
          date-month: 'overwriteDemand/month'
          date-year: 'overwriteDemand/year'
          page: 'currentPage'
      # Date year/month + pagination:
      - routePath: '/{date-year}/{date-month}/{page-label}-{page}'
        _controller: 'News::list'
        _arguments:
          date-month: 'overwriteDemand/month'
          date-year: 'overwriteDemand/year'
          page: 'currentPage'
    defaultController: 'News::list'
    defaults:
      page: '0'
      date-month: ''
      date-year: ''
    requirements:
      page: '\d+'
      date-month: '\d+'
      date-year: '\d+'
    aspects:
      news-title:
        type: NewsTitle
      page-label:
        type: LocaleModifier
        default: page
        localeMap:
          -
            locale: 'de_DE.*'
            value: seite
      page:
        type: StaticRangeMapper
        start: '1'
        end: '20'
      date-month:
        type: StaticValueMapper
        map:
          1: '01'
          2: '02'
          3: '03'
          4: '04'
          5: '05'
          6: '06'
          7: '07'
          8: '08'
          9: '09'
          10: '10'
          11: '11'
          12: '12'
        date-year:
          type: StaticRangeMapper
          start: '2000'
          end: '2030'

the routing is working fine, but the overwrite of the dateMenu is not working!
Bildschirmfoto 2023-08-07 um 12 12 38
It sticks to the first entries 2023...
Without configuring routing the routing for DateMenu everything works fine...I choose the year and month and the list switch to these news....

@georgringer
Copy link
Owner

please try

        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment

istead of

  type: NewsTitle

@trokohl
Copy link
Author

trokohl commented Sep 29, 2023

this works now but I could swear to have tried that too ... probably with an older version ...

@georgringer
Copy link
Owner

i feel the same, maybe test with previous core version - fixed there by accident? ^^

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

3 participants