简体   繁体   中英

TYPO3 9.5 slug redirect for extbase records results in PageNotFoundException

I want to be able to call blogpost entries by their slug, which is made of their title, through a routeEnhancer . The slug is generated correctly, but calling the URL results in a PageNotFoundException with the error message:

Request parameters could not be validated (&cHash empty)

And with links generated with Fluid:

<f:link.action action="show" arguments="{'blogpost': blogpost}" pageUid="{settings.ShowPid}">Weiterlesen</f:link.action>

... I get The requested page does not exist

Using TYPO3 9.5.16

Here's my config:

setup.typoscript

plugin.tx_exblog {
    config {
        defaultGetVars = 0
    }
    features {
        requireCHashArgumentForActionArguments = 0
    }
}

site/config.yaml

routeEnhancers:
    NewsPlugin:
        type: Extbase
        extension: ExBlog
        plugin: Show
        routes:
          - { routePath: '/{title}', _controller: 'Blogpost::show', _arguments: { title: blogpost } }
        defaultController: 'Blogpost::teaser'
        aspects:
          title:
            type: PersistedAliasMapper
            tableName: 'tx_exblog_domain_model_blogpost'
            routeFieldName: 'slug'
            routeValuePrefix: '/'

TCA

'slug' => [
            'label' => 'slug',
            'exclude' => true,
            'config' => [
                'type' => 'slug',
                'generatorOptions' => [
                    'fields' => ['title'],
                    'fieldSeparator' => '/',
                    'prefixParentPageSlug' => true,
                    'replacements' => [
                        '/' => '',
                    ],
                ],
                'fallbackCharacter' => '-',
                'eval' => 'uniqueInSite',
            ],
        ]

ext_tables.sql

slug varchar(255) DEFAULT '' NOT NULL,

Any ideas as to what am I missing?

There was a change in TYPO3 v9.5.16 regarding eval => "uniqueInSite" . Please verify if you really want to keep the blogposts unique in site. If this is the case the "pid" of the blogposts need to be within the same site. If you don't need this, just switch the eval to unique

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM