svn commit: r595582 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml

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

svn commit: r595582 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml

lektran
Author: lektran
Date: Thu Nov 15 22:57:57 2007
New Revision: 595582

URL: http://svn.apache.org/viewvc?rev=595582&view=rev
Log:
When associating a ProductCategory to a ProductCatalog, return a meaningful error message if the Product Category Id is invalid. Related to OFBIZ-1399

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml?rev=595582&r1=595581&r2=595582&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/catalog/CatalogServices.xml Thu Nov 15 22:57:57 2007
@@ -48,6 +48,11 @@
 
     <simple-method method-name="addProductCategoryToProdCatalog" short-description="Add Category To ProdCatalog">
         <check-permission permission="CATALOG" action="_CREATE"><fail-message message="Security Error: to run addProductCategoryToProdCatalog you must have the CATALOG_CREATE or CATALOG_ADMIN permission"/></check-permission>
+        <!-- Check that the ProductCategory exists -->
+        <entity-one entity-name="ProductCategory" value-name="productCategory"/>
+        <if-empty field-name="productCategory">
+            <add-error><fail-property resource="ProductUiLabels" property="ProductCategoryNotFoundforCategoryID"/></add-error>
+        </if-empty>
         <check-errors/>
 
         <make-value value-name="newEntity" entity-name="ProdCatalogCategory"/>