← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5653: Fixed bug <909995> OrganisationUnit: After updating orgunit, coordinates field becoming NULL

 

------------------------------------------------------------
revno: 5653
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-01-03 14:54:36 +0700
message:
  Fixed bug <909995> OrganisationUnit: After updating orgunit, coordinates field becoming NULL
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.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-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2011-12-14 17:16:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2012-01-03 07:54:36 +0000
@@ -264,15 +264,15 @@
             cDate = format.parseDate( closedDate );
         }
 
-        String coordinates = longitude != null && latitude != null ?
-            ValidationUtils.getCoordinate( longitude, latitude ) : null;
-        
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( id );
+
+        String coordinates = (longitude != null && latitude != null) ? ValidationUtils.getCoordinate( longitude,
+            latitude ) : (organisationUnit.getCoordinates() != null ? organisationUnit.getCoordinates() : null);
+
         // ---------------------------------------------------------------------
         // Update organisation unit
         // ---------------------------------------------------------------------
 
-        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( id );
-
         if ( !organisationUnit.getName().equals( name ) )
         {
             organisationUnitService.updateVersion();