svn commit: r1784708 - /ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/BreadCrumbs.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1784708 - /ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/BreadCrumbs.ftl

jleroux@apache.org
Author: jleroux
Date: Tue Feb 28 10:02:25 2017
New Revision: 1784708

URL: http://svn.apache.org/viewvc?rev=1784708&view=rev
Log:
Fixed: The ecommerce breadcrumb fails when you come from the catalog product
link
(OFBIZ-9234)

To reproduce
# Get to https://demo-stable.ofbiz.apache.org/catalog/control/EditProduct?productId=GZ-1000
# Click on the "Product Page" button

You may notice an error which does appear erratically but most of the time,
same on trunk demo and locally.

This happens because sometimes the _BREAD_CRUMB_TRAIL_ session attribute is
empty or null. "Why not alway?" you might ask. I had no time to investigate but
I guess because there is no bread crum trail when coming from catalog, and for
some weird reasons, it's sometimes there.

Anyway my fix is simple, if there is no _BREAD_CRUMB_TRAIL_  in session
I bypass the bread crum block in BreadCrumbs.ftl. It's not perfect but look far
better


Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/BreadCrumbs.ftl

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/BreadCrumbs.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/BreadCrumbs.ftl?rev=1784708&r1=1784707&r2=1784708&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/BreadCrumbs.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/entry/catalog/BreadCrumbs.ftl Tue Feb 28 10:02:25 2017
@@ -27,6 +27,7 @@ under the License.
     </li>
 </#if>    
     <#-- Show the category branch -->
+  <#if session.getAttribute("_BREAD_CRUMB_TRAIL_")??>
     <#assign crumbs = Static["org.apache.ofbiz.product.category.CategoryWorker"].getTrail(request)/>
     <#list crumbs as crumb>
          <#if catContentWrappers?? && catContentWrappers[crumb]??>
@@ -57,6 +58,7 @@ under the License.
             <#assign previousCategoryId = crumb />
          </#if>
     </#list>    
+  </#if>
     <#-- Show the product, if there is one -->
     <#if productContentWrapper??>
       <#if isDefaultTheme>