问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/61671770/typo3-9-5-slug-redirect-for-extbase-records-results-in-pagenotfoundexception