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:35:41 UTC

svn commit: r1686619 - /ofbiz/branches/release13.07/framework/common/script/org/ofbiz/common/CommonServices.xml

Author: arunpatidar
Date: Sat Jun 20 13:35:40 2015
New Revision: 1686619

URL: http://svn.apache.org/r1686619
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/branches/release13.07/framework/common/script/org/ofbiz/common/CommonServices.xml

Modified: ofbiz/branches/release13.07/framework/common/script/org/ofbiz/common/CommonServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/common/script/org/ofbiz/common/CommonServices.xml?rev=1686619&r1=1686618&r2=1686619&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/common/script/org/ofbiz/common/CommonServices.xml (original)
+++ ofbiz/branches/release13.07/framework/common/script/org/ofbiz/common/CommonServices.xml Sat Jun 20 13:35:40 2015
@@ -279,20 +279,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">