[TYPO3-mvc] Fluid / Extbase: empty LazyLoading object is fooling if-conditions

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jan 28 01:02:46 CET 2010


Hi,

sorry for continuously spamming this list - but I need my extension 
ready ASAP and thus can't debug hours and hours any longer. For the 
current project I already spent more time in debugging/adding missing 
features to extbase then actually coding the extension.

Following situation:
<f:if condition="{product.image}"><f:image src="{product.image.file}" 
/></f:if>

This little piece of code is bugging me for the following reason: If a 
image is present, the condition passes and the image is rendered. But if 
no image is available, the condition still passes and the image 
viewHelper is printing a "nice" error message. The reason for this is, 
that the image is loaded via LazyLoading and thus even if no image is 
available, the LazyLoading object is still present and confirming the 
condition.
I for now tried every possible condition (e.g. "{f:count(subject: 
product.image)} > 0") or whatever to make it work as intended, but 
didn't get it done so far.

So before I start to debug extbase/fluid (again) I ask you for help. Did 
I miss something?

And for the case I have to debug/patch - do you think this is more a bug 
of ExtBase (which shouldn't create a LazyLoading object if the db field 
has no value), or should FLUID take care of it?

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list