TYPO3 9.5的slug重定向,用于extbase记录结果在PageNotFoundException中 [英] TYPO3 9.5 slug redirect for extbase records results in PageNotFoundException

查看:58
本文介绍了TYPO3 9.5的slug重定向,用于extbase记录结果在PageNotFoundException中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够通过 routeEnhancer 通过他们的头衔来调用博客文章条目,该文章由标题组成.弹头生成正确,但是调用URL会导致 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:

请求参数无法验证(&chash为空)

以及使用Fluid生成的链接:

And with links generated with Fluid:

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

...我得到请求的页面不存在

使用TYPO3 9.5.16

Using TYPO3 9.5.16

这是我的配置:

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?

推荐答案

TYPO3 v9.5.16中有一个关于 eval =>的更改."uniqueInSite" .请确认您是否真的要在站点中保持博客文章的唯一性.如果是这种情况,则博客文章的"pid"必须位于同一站点内.如果您不需要此功能,只需将 eval 切换为 unique

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

这篇关于TYPO3 9.5的slug重定向,用于extbase记录结果在PageNotFoundException中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆