Author: hansbak
Date: Wed Jun  8 07:46:21 2011
New Revision: 1133270

URL: http://svn.apache.org/viewvc?rev=1133270&view=rev
Log:
ignore the locale on an incoming seo fiendly url, problem reported by mike 
wheeler

Modified:
    
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java
    
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/ajaxbreadcrumbs.ftl

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java?rev=1133270&r1=1133269&r2=1133270&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java
 Wed Jun  8 07:46:21 2011
@@ -182,7 +182,7 @@ public class CatalogUrlFilter extends Co
                     if (UtilValidate.isNotEmpty(productContentInfos)) {
                         for(GenericValue productContentInfo : 
productContentInfos){
                             String contentId = (String) 
productContentInfo.get("contentId");
-                            List<GenericValue> ContentAssocDataResourceViewTos 
= delegator.findByAndCache("ContentAssocDataResourceViewTo", 
UtilMisc.toMap("contentIdStart", contentId, "drLocaleString", localeString, 
"caContentAssocTypeId", "ALTERNATE_LOCALE", "drDataResourceTypeId", 
"ELECTRONIC_TEXT"));
+                            List<GenericValue> ContentAssocDataResourceViewTos 
= delegator.findByAndCache("ContentAssocDataResourceViewTo", 
UtilMisc.toMap("contentIdStart", contentId, "caContentAssocTypeId", 
"ALTERNATE_LOCALE", "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                             if 
(UtilValidate.isNotEmpty(ContentAssocDataResourceViewTos)){
                                 for (GenericValue 
ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
                                     GenericValue ElectronicText = 
ContentAssocDataResourceViewTo.getRelatedOneCache("ElectronicText");
@@ -201,8 +201,9 @@ public class CatalogUrlFilter extends Co
                                         }
                                     }
                                 }
-                            } else {
-                                List<GenericValue> contentDataResourceViews = 
delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", 
contentId, "statusId", "CTNT_IN_PROGRESS", "drDataResourceTypeId", 
"ELECTRONIC_TEXT"));
+                            } 
+                            if (UtilValidate.isEmpty(productId)) {
+                                List<GenericValue> contentDataResourceViews = 
delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", 
contentId, "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                                 for (GenericValue contentDataResourceView : 
contentDataResourceViews) {
                                     GenericValue ElectronicText = 
contentDataResourceView.getRelatedOneCache("ElectronicText");
                                     if 
(UtilValidate.isNotEmpty(ElectronicText)) {
@@ -236,7 +237,7 @@ public class CatalogUrlFilter extends Co
                     if (UtilValidate.isNotEmpty(productCategoryContentInfos)) {
                         for(GenericValue productCategoryContentInfo : 
productCategoryContentInfos){
                             String contentId = (String) 
productCategoryContentInfo.get("contentId");
-                            List<GenericValue> ContentAssocDataResourceViewTos 
= delegator.findByAndCache("ContentAssocDataResourceViewTo", 
UtilMisc.toMap("contentIdStart", contentId, "drLocaleString", localeString, 
"caContentAssocTypeId", "ALTERNATE_LOCALE", "drDataResourceTypeId", 
"ELECTRONIC_TEXT"));
+                            List<GenericValue> ContentAssocDataResourceViewTos 
= delegator.findByAndCache("ContentAssocDataResourceViewTo", 
UtilMisc.toMap("contentIdStart", contentId, "caContentAssocTypeId", 
"ALTERNATE_LOCALE", "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                             if 
(UtilValidate.isNotEmpty(ContentAssocDataResourceViewTos)){
                                 for (GenericValue 
ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
                                     GenericValue ElectronicText = 
ContentAssocDataResourceViewTo.getRelatedOneCache("ElectronicText");
@@ -257,8 +258,9 @@ public class CatalogUrlFilter extends Co
                                         }
                                     }
                                 }
-                            } else {
-                                List<GenericValue> contentDataResourceViews = 
delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", 
contentId, "statusId", "CTNT_IN_PROGRESS", "drDataResourceTypeId", 
"ELECTRONIC_TEXT"));
+                            } 
+                            if (UtilValidate.isEmpty(productCategoryId)) {
+                                List<GenericValue> contentDataResourceViews = 
delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", 
contentId, "drDataResourceTypeId", "ELECTRONIC_TEXT"));
                                 for (GenericValue contentDataResourceView : 
contentDataResourceViews) {
                                     GenericValue ElectronicText = 
contentDataResourceView.getRelatedOneCache("ElectronicText");
                                     if 
(UtilValidate.isNotEmpty(ElectronicText)) {

Modified: 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/ajaxbreadcrumbs.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/ajaxbreadcrumbs.ftl?rev=1133270&r1=1133269&r2=1133270&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/ajaxbreadcrumbs.ftl
 (original)
+++ 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/ajaxbreadcrumbs.ftl
 Wed Jun  8 07:46:21 2011
@@ -26,7 +26,7 @@ under the License.
     <#if productCategoryTrail?exists>
         <#list productCategoryTrail as trail>
         <li>
-          <a href="<@ofbizCatalogUrl currentCategoryId=trail.productCategoryId 
previousCategoryId=trail.parentCategory/>" class="linktext">
+          <a href="<@ofbizCatalogAltUrl 
productCategoryId=trail.productCategoryId 
previousCategoryId=trail.parentCategory!""/>" class="linktext">
             <#if trail.title?exists>
               ${trail.title}
             <#else>
@@ -37,7 +37,7 @@ under the License.
         </#list>
     </#if>
     <li>
-      <a href="<@ofbizCatalogUrl currentCategoryId=currentCategoryId 
previousCategoryId=parameters.parentCategoryStr/>" class="linktext">
+      <a href="<@ofbizCatalogAltUrl productCategoryId=currentCategoryId 
previousCategoryId=parameters.parentCategoryStr/>" class="linktext">
         <#if currentCategoryName?exists>
           ${currentCategoryName}
         <#elseif currentCategoryDescription?exists>


Reply via email to