Skip to content

Commit

Permalink
[OFBIZ-6237] Applied patch from the task. Fixed the issue of deleting…
Browse files Browse the repository at this point in the history
… existing GeoAssocs records while addind new GeoAssocs. Thanks Himanil Gupta for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1686616 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Arun Patidar committed Jun 20, 2015
1 parent 70927cf commit 60504a8
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions framework/common/script/org/ofbiz/common/CommonServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 60504a8

Please sign in to comment.