[TYPO3-dev] Bug in ForViewHelper -> only first element shown

Michael Bakonyi m.bakonyi at civit.de
Thu Aug 29 12:16:03 CEST 2013


Hi Philipp,

thx a lot for your answer!

[quote]I think it is a problem you set your QueryResult in your demand object. The QueryResult is still a object and when you pass it to your foreach it gets transformed but the reference is still in your demand object. [/quote]

I don't understand what you mean exactly. Why is it a problem that the reference is the demand-object? It is still a regular object and should be rendered as usual.

[quote]You expect a ObjectStorage anyway in the demandObject, so why dont check for the type and simply set the QueryResult as property? That seems a little confuising and might cause the problem.[/quote]

I don't know what you mean exactly again. I do set the QueryResult als property of the Filter-object ..?

[quote]Additionially your f:form property name should be exchanged with objectName.[/quote]

It was before I setup the extension code for this mailinglist ;)

[quote]The checkbox viiewHelper cant be bound to ObjectStorages, only to boolean and array properties, so your demand object contains one more error. [/quote]

Well from my experience it can be bound to objects aswell if you write an additional viewhelper which checks which checkbox is checked. (nice sentence :) This works quite well for me. I just removed the viewhelper from the code so that you're not led to the direction of "maybe your vw is the problem". Because also without the vw the code isn't working as expected.

[quote]The demand is transient anyway, so why use a persistent storage object?[/quote]

You're right I wouldn't need it. But it's comfortable this way together with the solution you posted beyond.

[quote]You dont have to define the objectmanager in your actioncontroller, its allready there inherited from its parent. Saves you a view lines of code.[/quote]

Cool thx!

[quote]First i would define the demand-property as array and assign your results as array (QueryResult->toArray()).[/quote]

Yeah, this is a working workaround! Thanks a lot! :) 

Cheers,
Michael



More information about the TYPO3-dev mailing list