[TYPO3-mvc] Possible bug: LazyObjectStorage->toArray should initialize the objectStorage first?

Jochen Rau jochen.rau at typoplanet.de
Sun May 30 12:44:53 CEST 2010


Hi Franz.

On 29.05.10 00:28, Franz Koch wrote:
> Hey there,
>
> I'm currently porting my extbase based extension dated back to march to
> the current SVN version and noticed a changed behavior.
>
> I'm using a LazyObjectStorage as property of a model and had it
> converted to a plain array via $myLazyObjectStorage->toArray();. I do
> this, because I like to merge the results of various parent objects
> ($collection =
> array_merge($collection,$myObject->getMyLazyProperty()->toArray()).
> This used worked just fine before, but now it's returning an empty
> array, because the LazyObjectStorage is not initialized before. So
> question is, should this method take care of the initialization, or are
> we supposed to initialize the LazyObjectStorage via some other API calls
> (like ->valid() or ->rewind()) first (which feels a bit odd)? What do
> you guys thing about it?

That's a bug. Please test the attached patch if it fixes the problem for 
you.

Regards
Jochen




More information about the TYPO3-project-typo3v4mvc mailing list