You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/06/02 11:46:28 UTC

svn commit: r1345473 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

Author: jleroux
Date: Sat Jun  2 09:46:28 2012
New Revision: 1345473

URL: http://svn.apache.org/viewvc?rev=1345473&view=rev
Log:
Fix a small bug, related to recent Freemarker changes, reported on user ML

Modified:
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl?rev=1345473&r1=1345472&r2=1345473&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl Sat Jun  2 09:46:28 2012
@@ -355,7 +355,7 @@ $(function(){
     
     <hr />
     <div id="productImageBox">
-        <#if productImageList != null && productImageList?has_content>
+        <#if productImageList?has_content && productImageList?has_content>
             <#-- Product image/name/price -->
             <div id="detailImageBox">
                 <#assign productLargeImageUrl = productContentWrapper.get("LARGE_IMAGE_URL")?if_exists />



Re: svn commit: r1345473 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Jun 2, 2012, at 12:43 PM, Jacques Le Roux wrote:

> PS: oops, I'm really tired, I just realise that I have duplicated the check 

Yes, this is what I meant

Jacopo

Re: svn commit: r1345473 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

Posted by Jacques Le Roux <ja...@les7arts.com>.
BTW I find the definition of ?? unclear at 
http://freemarker.sourceforge.net/docs/dgui_template_exp.html#dgui_template_exp_missing_test

When the one of has_content  is much more clear and complete 
http://freemarker.sourceforge.net/docs/ref_builtins_expert.html#ref_builtin_has_content

Jacques

From: "Jacques Le Roux" <ja...@les7arts.com>
> 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" <ja...@hotwaxmedia.com>
>>
>> On Jun 2, 2012, at 11:46 AM, jleroux@apache.org 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
>>
>
> 

Re: svn commit: r1345473 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

Posted by Jacques Le Roux <ja...@les7arts.com>.
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" <ja...@hotwaxmedia.com>
>
> On Jun 2, 2012, at 11:46 AM, jleroux@apache.org 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
>



Re: svn commit: r1345473 - /ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Jun 2, 2012, at 11:46 AM, jleroux@apache.org 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