svn commit: r1826677 - /ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml

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

svn commit: r1826677 - /ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml

mbrohl
Author: mbrohl
Date: Tue Mar 13 20:03:44 2018
New Revision: 1826677

URL: http://svn.apache.org/viewvc?rev=1826677&view=rev
Log:
Improved: Make removeContentAndRelated service fail-save for missing
content and remove related ContentAttributes also.
(OFBIZ-10202)

Thanks Martin Becker for reporting and providing the patch.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml?rev=1826677&r1=1826676&r2=1826677&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/minilang/content/ContentServices.xml Tue Mar 13 20:03:44 2018
@@ -71,23 +71,26 @@
     </simple-method>
     <simple-method method-name="removeContentAndRelated" short-description="Remove a Content Record, related resource(s) and assocs.">
         <entity-one entity-name="Content" value-field="content"/>
-        <remove-related value-field="content" relation-name="ContentRole"/>
-        <remove-related value-field="content" relation-name="ContentKeyword"/>
-        <remove-related value-field="content" relation-name="FromContentAssoc"/>
-        <remove-related value-field="content" relation-name="ToContentAssoc"/>
-        <remove-value value-field="content"/>
-        <get-related-one value-field="content" relation-name="DataResource" to-value-field="dataResource"/>
-        <if-not-empty field="dataResource">
-            <get-related-one value-field="dataResource" relation-name="ImageDataResource" to-value-field="imageDataResource"/>
-            <if-not-empty field="imageDataResource">
-                <remove-value value-field="imageDataResource"/>
-            </if-not-empty>
-            <get-related-one value-field="dataResource" relation-name="ElectronicText" to-value-field="electronicText"/>
-            <if-not-empty field="electronicText">
-                <remove-value value-field="electronicText"/>
+        <if-not-empty field="content">
+            <remove-related value-field="content" relation-name="ContentAttribute"/>
+            <remove-related value-field="content" relation-name="ContentRole"/>
+            <remove-related value-field="content" relation-name="ContentKeyword"/>
+            <remove-related value-field="content" relation-name="FromContentAssoc"/>
+            <remove-related value-field="content" relation-name="ToContentAssoc"/>
+            <remove-value value-field="content"/>
+            <get-related-one value-field="content" relation-name="DataResource" to-value-field="dataResource"/>
+            <if-not-empty field="dataResource">
+                <get-related-one value-field="dataResource" relation-name="ImageDataResource" to-value-field="imageDataResource"/>
+                <if-not-empty field="imageDataResource">
+                    <remove-value value-field="imageDataResource"/>
+                </if-not-empty>
+                <get-related-one value-field="dataResource" relation-name="ElectronicText" to-value-field="electronicText"/>
+                <if-not-empty field="electronicText">
+                    <remove-value value-field="electronicText"/>
+                </if-not-empty>
+                <remove-related value-field="dataResource" relation-name="DataResourceRole"/>
+                <remove-value value-field="dataResource"/>
             </if-not-empty>
-            <remove-related value-field="dataResource" relation-name="DataResourceRole"/>
-            <remove-value value-field="dataResource"/>
         </if-not-empty>
     </simple-method>
 
@@ -877,7 +880,7 @@
             <condition>
                 <or>
                     <if-empty field="parameters.contentId"/>
-                    <if-compare operator="equals" value="null" field="parameters.contentId"></if-compare>
+                    <if-compare operator="equals" value="null" field="parameters.contentId"/>
                 </or>
             </condition>
             <then>