Jacopo,
I vaguely remembered OFBIZ-4916, but as has_content is not deprecated
http://freemarker.sourceforge.net/docs/ref_depr_builtin.html
http://freemarker.sourceforge.net/docs/ref_builtins_expert.html#ref_builtin_has_content
I did not see any reasons to not use it there. I see it as
UtilValidate.isNotEmtpy() in Java. I like the idea of having null and
empty checked at the same time (belt and suspenders). And last but not least I
find it easier to read than ?? which is not exactly
the same. It's the deprecated ?exists, I proposed to use long ago
http://markmail.org/message/6ipezxj65gcwlann
So since has_content tests for null value I don't see the need to repeat with
something like
<#if productImageList?? && productImageList?has_content>
as has_content implies/includes ??
Did I miss something? I wonder now why in the past there was a test on null...
Jacques
PS: oops, I'm really tired, I just realise that I have duplicated the check :D,
OK I fix. Or rather you are right I will revert and
review commit OFBIZ-4916. Thanks for the link!
From: "Jacopo Cappellato" <[email protected]>
On Jun 2, 2012, at 11:46 AM, [email protected] wrote:
- <#if productImageList != null && productImageList?has_content>
+ <#if productImageList?has_content && productImageList?has_content>
Jacques, please double check the change you did.
As a side note, it would be better to revert this and review and commit:
https://issues.apache.org/jira/browse/OFBIZ-4916
Jacopo