Author: ashish
Date: Thu Nov 27 11:32:46 2014
New Revision: 1642104
URL: http://svn.apache.org/r1642104
Log:
Applied patch from jira issue - OFBIZ-5844 - Convert java files to EntityQuery.
================================================================
Ashish Vijaywargiya / Arun Patidar: Getting error on
http://demo-trunk-ofbiz.apache.org/ecommerce/round-gizmo-GZ-2644-p due to
commit revision r1641044. There is an issue in CatalogUrlFilter class.
Attaching the patch to fix the problem. Here is the error for your quick
reference;
java.lang.IllegalArgumentException: You must pass an even sized array to the
toMap method (size = 1)
org.ofbiz.base.util.UtilMisc.toMap(UtilMisc.java:158)
org.ofbiz.entity.util.EntityQuery.where(EntityQuery.java:160)
org.ofbiz.product.category.CatalogUrlFilter.doFilter(CatalogUrlFilter.java:97)
================================================================
Thanks Rishi for the contribution.
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java
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=1642104&r1=1642103&r2=1642104&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
Thu Nov 27 11:32:46 2014
@@ -94,7 +94,7 @@ public class CatalogUrlFilter extends Co
if (UtilValidate.isNotEmpty(productContentInfos)) {
for (GenericValue productContentInfo :
productContentInfos) {
String contentId = (String)
productContentInfo.get("contentId");
- List<GenericValue> ContentAssocDataResourceViewTos
=
EntityQuery.use(delegator).where("ContentAssocDataResourceViewTo").where("contentIdStart",
contentId, "caContentAssocTypeId", "ALTERNATE_LOCALE", "drDataResourceTypeId",
"ELECTRONIC_TEXT").cache(true).queryList();
+ List<GenericValue> ContentAssocDataResourceViewTos
=
EntityQuery.use(delegator).from("ContentAssocDataResourceViewTo").where("contentIdStart",
contentId, "caContentAssocTypeId", "ALTERNATE_LOCALE", "drDataResourceTypeId",
"ELECTRONIC_TEXT").cache(true).queryList();
if
(UtilValidate.isNotEmpty(ContentAssocDataResourceViewTos)) {
for (GenericValue
ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
GenericValue ElectronicText =
ContentAssocDataResourceViewTo.getRelatedOne("ElectronicText", true);
@@ -115,7 +115,7 @@ public class CatalogUrlFilter extends Co
}
}
if (UtilValidate.isEmpty(productId)) {
- List<GenericValue> contentDataResourceViews =
EntityQuery.use(delegator).where("ContentDataResourceView").where("contentId",
contentId, "drDataResourceTypeId", "ELECTRONIC_TEXT").cache(true).queryList();
+ List<GenericValue> contentDataResourceViews =
EntityQuery.use(delegator).from("ContentDataResourceView").where("contentId",
contentId, "drDataResourceTypeId", "ELECTRONIC_TEXT").cache(true).queryList();
for (GenericValue contentDataResourceView :
contentDataResourceViews) {
GenericValue ElectronicText =
contentDataResourceView.getRelatedOne("ElectronicText", true);
if
(UtilValidate.isNotEmpty(ElectronicText)) {