rupertgermann / tt_news

TYPO3 Extension - News (tt_news)
21 stars 37 forks source link

Route enhancing on multi domain system using slug field #172

Open lrsvgl opened 3 years ago

lrsvgl commented 3 years ago

On a multi domain page I have articles to deliver across the domains. In list view the plugin is configured to show a certain category for delivery of articles across domains, functions as expected. By trying to get the detailView the system shows a 404 page not found message.

The configuration of the route enhancing is:

TtNewsDetail: type: Plugin namespace: tx_ttnews routePath: '/artikel/{tt_news}' aspects: tt_news: type: PersistedAliasMapper tableName: tt_news routeFieldName: slug defaults: tt_news: '0'

If I change the routeFieldName for example to „uid“, „crdate“ or even „title“ the article is shown in detailView. Changing back to the field „slug“ the 404 page is shown.

Knowing that I figured out and deleted all duplicates in the slug field. No change of behaviour. Finally in my developing system I deleted all articles except one und the behaviour is still the same.

Actually I’m running out of ideas. Maybe there is a wrong configuration concerning cHashes? Or the RouteEnhancing is not optimal?

Thank You in advance.

romanchev commented 3 years ago

I have the same problem. I have sysfolder for tt_news outside the website tree. The problem is related to TCA settings for slug field for tt_news. If you change 'eval' => 'uniqueInSite', to 'eval' => 'unique', the problem will be solved.

There are some conditions related to the situation in typo3/sysext/core/Classes/Routing/Aspect/PersistedAliasMapper.php and it seems this conditions produce the problem

        if ($this->slugUniqueInSite) {
            $results = array_values($this->filterContainedInSite($results));
        }