You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2010/09/07 15:19:02 UTC

svn commit: r993344 - /ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml

Author: ashish
Date: Tue Sep  7 13:19:02 2010
New Revision: 993344

URL: http://svn.apache.org/viewvc?rev=993344&view=rev
Log:
Applied patch from jira issue - OFBIZ-3923 - Bug in updating local file content.

attachUploadToDataResource (member service of updateContentAndUploadedFile service group) service calls saveLocalFileDateResource simple method to save the local file and attach it to data resource. The case where updating a local file content but not uploading a new file is being handled but doesn't work since on finding DataResource object "isUpdate" flag is not set to "Y".

Here is the patch for the fix. Also fixed typo in simple method name, saveLocalFileDateResource => saveLocalFileDataResource.

Thanks Mridul for the contribution.

Modified:
    ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml

Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml?rev=993344&r1=993343&r2=993344&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml (original)
+++ ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml Tue Sep  7 13:19:02 2010
@@ -589,7 +589,7 @@ under the License.
         </if-empty>
 
         <if-compare field="parameters.dataResourceTypeId" value="LOCAL_FILE" operator="equals">
-            <call-simple-method method-name="saveLocalFileDateResource"/>
+            <call-simple-method method-name="saveLocalFileDataResource"/>
             <return/>
         </if-compare>
 
@@ -642,10 +642,15 @@ under the License.
     </simple-method>
 
     <!-- save LOCAL_FILE data -->
-    <simple-method method-name="saveLocalFileDateResource" short-description="Attach an uploaded file to a data resource as LOCAL_FILE">
+    <simple-method method-name="saveLocalFileDataResource" short-description="Attach an uploaded file to a data resource as LOCAL_FILE">
         <entity-one entity-name="DataResource" value-field="dataResource"/>
         <if-empty field="dataResource">
             <add-error><fail-message message="No data resource found for ID: [${parameters.dataResourceId}]"/></add-error>
+            <else>
+                <if-not-empty field="dataResource.objectInfo">
+                    <set field="isUpdate" value="Y"/>
+                </if-not-empty>
+            </else>
         </if-empty>
         <if>
             <condition>