Typo3 Extbase存储库-> findAll()返回空 [英] Typo3 Extbase Repository->findAll() returns empty

查看:65
本文介绍了Typo3 Extbase存储库-> findAll()返回空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是不能打字稿解决方案记录存储页面错误,但没有成功. >

我在TYPO3中使用虚拟扩展程序生成的扩展代码(当前版本)为您提供方便.我已经测试了通过TYPO3 config ui手动添加的数据.

任何帮助将不胜感激.

最好,谢谢!

马里奥(Mario)

解决方案

对于99.9%,您没有正确设置storagePid,它必须是存储记录的页面的PID.效果:findAll()使用此PID来过滤记录,而findByUid(uid)忽略PID(它会在存储记录的位置按UID进行搜索.

转到主页>模板,并确保已从新ext中包括TypoScript,然后转到常量编辑器并使用记录设置页面的正确PID.最后清除整个缓存

此外,您也可以像此答案一样调试 的SQL语句,最有可能在语句末尾看到类似于AND your_table_name.pid IN (0)之类的东西,这绝对意味着您未设置storagePid或未清除缓存.

I just can't findAll() make return anything even though I am able to access a specific record by findByUid().

I have taken note (and tried to workaround / set up) of the typoscript solution and the record storage page bug without any success.

I am using a dummy extension code made by the extension builder in TYPO3 (current version) for your convenience. I have tested with data manually added through the TYPO3 config ui.

Any help would be much appreciated.

All the best and thanks in advance

Mario

解决方案

For 99.9 % you didn't set your storagePid properly, it has to be the PID of the page where your records are stored. Effect: findAll() uses this PID to filter the records, while findByUid(uid) ignores PID (it searches by UID wherever record is stored.

Go to the main page > Templates and make sure that you included TypoScript from your new ext, then go to constant editor and set proper PID of page with your records. Clear whole cache at the end!

Also you can debug your SQL statement like in this answer, most probably at the end of statement you'll see something like AND your_table_name.pid IN (0) which definitely means that you didn't set storagePid or you didn't clear the cache.

这篇关于Typo3 Extbase存储库-> findAll()返回空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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