[TYPO3-mvc] Strange warning "You should never see it"

Dawid Pacholczyk dpacholczyk at gmail.com
Wed Jan 19 20:02:11 CET 2011


On 19.01.2011 18:00, Sebastian Kurfürst wrote:
> Hey Dawid,
>
>> I get nothing in my listAction
> This means you do not get any results?
>
>> when I used var_dump($records) I receive
>>
>> object(Tx_Extbase_Persistence_QueryResult)[112]
>>    private 'warning' =>  string 'You should never see this warning. If you
>> do, you probably used PHP array functions like current() on the
>> Tx_Extbase_Persistence_QueryResult. To retrieve the first result, you
>> can use the getFirst() method.' (length=206)
> That's no problem you need to take care of; it is just to inform
> developers of legacy code that they need to do something; Details at
> http://forge.typo3.org/projects/typo3v4-mvc/wiki/QueryResult
>
> The warning is only implemented because PHP sucks ;-) If you do
> current($object), then PHP will return THE FIRST property of the object,
> no matter it's visibility (which is plain wrong and inconsistent).
> Before Extbase 1.4, $query->execute() returned an *array*, where you
> could of course do current($array). Extbase 1.4 returns a QueryResult
> *object*, which is basically executing your query lazily as needed. But
> in order to give people who upgrade and use current() a meaningful
> message, we added this property with the warning message.
>
> Please try to debug $records->toArray(), to see if some records are
> fetched. If not, it's most probably a problem with your storage PID
> settings. Could you post your TypoScript here?
>
> Greets,
> Sebastian

Hi Sebastian !

I`ve done this checks before :)

But I`ll answer your questions cause maybe I`m doing something wrong :)

Yes, I`m NOT getting any results. I`ll tell even more. If I put $results 
ito print_r -> print_r($results), then there is some kind of infinity 
loop. The browser is thinking for 5-6 minutes then crashes.

I`ve already used toArray() and I receive empty array

Below are infos from ma earlier mail

$records = $this->recordRepository->findAll();  <-- didn`t help. I 
receive empty array

fluid version is the same as in typo3 4.5 beta4 version

about the pid. yes I did but maybe i did it wrong. I did it like that

plugin.tx_myext.persistence.storagePid = 2

Best regards,
Dawid Pacholczyk


More information about the TYPO3-project-typo3v4mvc mailing list