0
votes

When I call a news detail page with a non existing news path segment (www.example.de/news-detail/this-news-does-not-exist/), i get redirected to the 404 page, which is configured in the config.yaml. Is it possible also to control non-existing news urls via the plugin.tx_news.settings.detail.errorHandling configuration (https://docs.typo3.org/p/georgringer/news/master/en-us/AdministratorManual/Configuration/TypoScript/Index.html?highlight=errorhandling#detail-errorhandling)? Or is there another way to bypass the 404 handling or to configre the 404 error handling specially for news errors?

Setup: TYPO3 9.5.19 News 8.3.0

config.yaml News Detail Configuration:

NewsDetail:
    type: Extbase
    extension: News
    plugin: Pi1
    limitToPages:
      - 22
    routes:
      - routePath: '/{news_title}'
        _controller: 'News::detail'
        _arguments:
          news_title: news
    defaultController: 'News::detail'
    defaults:
      page: '0'
    requirements:
      page: \d+
    aspects:
      news_title:
        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment
1

1 Answers

0
votes

This is a known bug in the tx_news: https://github.com/georgringer/news/issues/1018 Unfortunately there is no fix yet available.

As a workaround you can use your own error handling. Add to your website-extension an own class for page error handling.

Change the error handling in the site configuration to PHP and set "ErrorHandler Class Target" to your class path.

Not really pretty, but it works.