[TYPO3-mvc] Easy query results in Error 500

Stefan Frömken firma at sfroemken.de
Wed Nov 16 12:06:13 CET 2011


Am 16.11.2011 11:43, schrieb Stefan Frömken:
> Am 16.11.2011 11:12, schrieb Stefan Frömken:
>> Hello MVC-List,
>>
>> I have a very simple Query:
>>
>> $query = $this->createQuery();
>> $query->setQuerySettings($query->getQuerySettings()->setRespectStoragePage(FALSE));
>>
>>
>> $query->matching($query->equals('pid', $uid))->execute();
>>
>> and there are no problem within LIVE-Workspace.
>>
>> But when I'm in a workspace I got an error 500. On my local DEV-System
>> my Firefox crashes after 30-40 seconds.
>>
>> And ideas how/where to debug this?!
>>
>> We are working with TYPO3 4.5.7
>>
>> Stefan
>
> Sorry...execute() is not the problem. In my queryResult are 5 normal
> records but the 6th is an "INITIAL PLACEHOLDER". Maybe this record
> crashes my query. I'll test it.

I tried to generate a little rootline:

foreach($query->matching($query->equals('pid', $uid))->execute() as 
$object) {
   $object->setPages($this->getNestedPages($object->getUid()));
   if(!t3lib_div::inList($this->getExcludeList(), $object->getUid())) {
     $localStorage->attach($object);
   }
}

But in workspace mode ->getUid() returns 0!!! Further the generated 
SQL-Query s much smaller. It only checks for deleted=0 and nothing more?!

So for now I have added a little check against getUid() to get my 
extension to work again.

foreach($query->matching($query->equals('pid', $uid))->execute() as 
$object) {
   if($object->getUid()) {
     $object->setPages($this->getNestedPages($object->getUid()));
     if(!t3lib_div::inList($this->getExcludeList(), $object->getUid())) {
       $localStorage->attach($object);
     }
   }
}

Let me know if there are any better solutions...

Stefan


More information about the TYPO3-project-typo3v4mvc mailing list