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 2011/04/02 16:19:25 UTC

svn commit: r1088034 - /ofbiz/branches/release09.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy

Author: jleroux
Date: Sat Apr  2 14:19:24 2011
New Revision: 1088034

URL: http://svn.apache.org/viewvc?rev=1088034&view=rev
Log:
A patch from "Product page meta-tag does not contain i18n content" https://issues.apache.org/jira/browse/OFBIZ-4208

the groovy script that produces the content meta information is only partially using i18n information from the Content Wrapper. Namely, it does NOT use the Product or Category ContentWrapper to receive internationalized content for Product Name and Description or Category Description but rather the direct properties of the product entity.
Using the ContentWrapper will overcome this shortcoming.

The fix needs to be applied in applications/order/webapp/ordermgr/WEB-INF/actions/cart/catalog/Product.groovy

It is assumed that ContentWrappers will handle primitive over related Content properly, ie. if there is no related Content entity but only primitive content, it will return that. And if there is i18n content missing in the desired (current session) locale, it will return the default locale translation.

Modified:
    ofbiz/branches/release09.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy

Modified: ofbiz/branches/release09.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy?rev=1088034&r1=1088033&r2=1088034&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy (original)
+++ ofbiz/branches/release09.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy Sat Apr  2 14:19:24 2011
@@ -86,8 +86,10 @@ if (productId) {
         members = delegator.findByAndCache("ProductCategoryMember", [productId : productId]);
         members.each { member ->
             category = member.getRelatedOneCache("ProductCategory");
-            if (category.description) {
-                keywords.add(category.description);
+            categoryContentWrapper = new CategoryContentWrapper(category, request);
+            categoryDescription = categoryContentWrapper.DESCRIPTION;
+            if (categoryDescription) {
+                keywords.add(categoryDescription);
             }
         }
         context.metaKeywords = StringUtil.join(keywords, ", ");