1

使用 extbase 我开发了一个扩展。然后我使用 Realurl 进行 url 重写。

问题是,例如,我执行这个 url:www.mysite.com/records/record-number-one/ 一切都很好,因为“record-number-one”确实存在。

现在如果我尝试

www.mysite.com/records/record-numbbbbbbber-one/

我收到了这个错误

Exception while property mapping at property path "":The identity
property "record-numbbbbbbber-one" is no UID.

但我想被重定向到 404 页面而不是收到此错误!

我试图在我的操作中验证记录并重定向到 404 页面,但是当我收到此错误时,我的代码(在我的操作中)甚至没有执行!

经过大量搜索,有人说如果我设置

plugin.myplugin.mvc.throwPageNotFoundExceptionIfActionCantBeResolved = 1

或者干脆

config.tx_extbase.mvc.throwPageNotFoundExceptionIfActionCantBeResolved = 1

错误将得到解决,我都尝试了,但我仍然得到错误。

有什么帮助吗?

谢谢

PS:我使用 TYPO3 6.1.7

4

2 回答 2

5

通过添加 'enable404forInvalidAlias' => 1 在 realurl 配置中修复此问题

例如:

'lookUpTable' => array(
'table' => 'tx_example_domain_model_example',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted AND NOT hidden',
'enable404forInvalidAlias' => 1,
),
于 2015-04-21T14:51:41.523 回答
1

在您的操作中,您需要使用@dontvalidate.

于 2014-03-12T08:04:10.760 回答