You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2012/05/22 05:33:03 UTC

svn commit: r1341293 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java

Author: hansbak
Date: Tue May 22 03:33:03 2012
New Revision: 1341293

URL: http://svn.apache.org/viewvc?rev=1341293&view=rev
Log:
assume tag status is pending when not provided

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=1341293&r1=1341292&r2=1341293&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java Tue May 22 03:33:03 2012
@@ -1179,6 +1179,7 @@ public class ProductEvents {
         LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
         String productId = request.getParameter("productId");
         String productTags = request.getParameter("productTags");
+        String statusId = request.getParameter("statusId");
         if (UtilValidate.isNotEmpty(productId) && UtilValidate.isNotEmpty(productTags)) {
             List<String> matchList = FastList.newInstance();
             Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
@@ -1195,10 +1196,14 @@ public class ProductEvents {
                 return "error";
             }
             
+            if(UtilValidate.isEmpty(statusId)) {
+                statusId = "KW_PENDING";
+            }
+            
             if(UtilValidate.isNotEmpty(matchList)) {
                 for (String keywordStr : matchList) {
                     try {
-                        dispatcher.runSync("createProductKeyword", UtilMisc.toMap("productId", productId, "keyword", keywordStr.trim(), "keywordTypeId", "KWT_TAG","statusId","KW_PENDING" , "userLogin", userLogin));
+                        dispatcher.runSync("createProductKeyword", UtilMisc.toMap("productId", productId, "keyword", keywordStr.trim(), "keywordTypeId", "KWT_TAG", "statusId", statusId, "userLogin", userLogin));
                     } catch (GenericServiceException e) {
                         request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
                         return "error";