[TYPO3-mvc] Problems with setIgnoreEnableFields

Helmut Hummel helmut.hummel at typo3.org
Fri Jul 31 11:56:30 CEST 2015


Hi!

Philipp Wrann wrote:
> This behaviour is correct, if an endtime is reached the object is invalid and you should throw a 404 error.

The reason for that behaviour actuall is the PersistentObjectConverter 
which always respects the enable fields when mapping a request to a 
persitent object.

You can add your own converter however for your object type and make it 
configurable (or harcode your needs)

See: https://gist.github.com/helhum/58a406fbb846b56a8b50

for an example.

> BTW:
>
> Its easier to overwrite the createQuery method
>
> public function createQuery() {
> $query = parent::createQuery();
> $query->getQuerySettings()->setRespectStoragePage(FALSE);
> return $query;
> }

Yes, this would also be fine that way.

> A quick fix for your problem:
>
> add
>
> initializeDetailAction () {
> // or whatever action should ignore that setting
> unset($GLOBALS['TCA']['tablename']['ctrl']['enablecolumns']['endtime']);
> }

This is a very dangerous hack. TCA information will be cached by Extbase 
and you could end up in different behaviour depending on what action is 
called first, at worst exposing objects you do not want to expose.


Kind regards,
Helmut

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 CMS Active Contributor, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-project-typo3v4mvc mailing list