You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ar...@apache.org on 2015/06/20 15:28:30 UTC

svn commit: r1686616 - /ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml

Author: arunpatidar
Date: Sat Jun 20 13:28:30 2015
New Revision: 1686616

URL: http://svn.apache.org/r1686616
Log:
[OFBIZ-6237] Applied patch from the task. Fixed the issue of deleting existing GeoAssocs records while addind new GeoAssocs. Thanks Himanil Gupta for your contribution.

Modified:
    ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml

Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml?rev=1686616&r1=1686615&r2=1686616&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml (original)
+++ ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml Sat Jun 20 13:28:30 2015
@@ -271,20 +271,9 @@ under the License.
     <simple-method method-name="linkGeos" short-description="Link Geos to another Geo">
         <entity-and entity-name="GeoAssoc" list="geoAssocs">
             <field-map field-name="geoId" from-field="parameters.geoId"/>
+            <field-map field-name="geoAssocTypeId" from-field="parameters.geoAssocTypeId"/>
         </entity-and>
-        <!-- Current list contains old values? -->
-        <iterate list="geoAssocs" entry="geoAssoc">
-            <if-compare-field field="parameters.geoIds" operator="contains" to-field="geoAssoc.geoIdTo">
-                <!-- Yes, nothing to do, it already exists and we keep it -->
-                <else><!-- Remove -->
-                    <entity-one entity-name="GeoAssoc" value-field="oldGeoAssoc">
-                        <field-map field-name="geoId" from-field="parameters.geoId"/>
-                        <field-map field-name="geoIdTo" from-field="geoAssoc.geoIdTo"/>
-                    </entity-one>
-                    <remove-value value-field="oldGeoAssoc"/>
-                </else>
-            </if-compare-field>
-        </iterate>
+        <set field="oldGeoIds" value="${groovy:org.ofbiz.entity.util.EntityUtil.getFieldListFromEntityList(geoAssocs, 'geoIdTo', true);}"/>
         <!-- Old list contains current values -->
         <iterate list="parameters.geoIds" entry="geoIdTo">
             <if-compare-field field="oldGeoIds" operator="contains" to-field="geoIdTo">