← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18013: minor fix

 

------------------------------------------------------------
revno: 18013
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-01-16 11:39:08 +0700
message:
  minor fix
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2015-01-16 04:15:14 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2015-01-16 04:39:08 +0000
@@ -437,7 +437,17 @@
 
         reattachFields( object, fields, user );
 
-        persistedObject.mergeWith( object );
+        if ( !options.isSharing() )
+        {
+            User persistedObjectUser = persistedObject.getUser();
+            persistedObject.mergeWith( object );
+            persistedObject.setUser( persistedObjectUser );
+        }
+        else
+        {
+            persistedObject.mergeWith( object );
+            persistedObject.mergeSharingWith( object );
+        }
 
         updatePeriodTypes( persistedObject );