← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17425: minor fix, return real uid in period if it is set

 

------------------------------------------------------------
revno: 17425
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-11-11 16:14:10 +0545
message:
  minor fix, return real uid in period if it is set
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/Period.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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-api/src/main/java/org/hisp/dhis/period/Period.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/Period.java	2014-10-13 12:24:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/Period.java	2014-11-11 10:29:10 +0000
@@ -122,7 +122,7 @@
     @Override
     public String getUid()
     {
-        return getIsoDate();
+        return uid != null ? uid : getIsoDate();
     }
 
     public String getRealUid()

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2014-11-11 09:20:01 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2014-11-11 10:29:10 +0000
@@ -112,6 +112,7 @@
 import static org.hisp.dhis.analytics.DataQueryParams.*;
 import static org.hisp.dhis.common.DimensionalObject.*;
 import static org.hisp.dhis.common.DimensionalObjectUtils.toDimension;
+import static org.hisp.dhis.common.IdentifiableObjectUtils.getLocalPeriodIdentifier;
 import static org.hisp.dhis.common.IdentifiableObjectUtils.getLocalPeriodIdentifiers;
 import static org.hisp.dhis.common.IdentifiableObjectUtils.getUids;
 import static org.hisp.dhis.common.NameableObjectUtils.asList;
@@ -974,7 +975,7 @@
 
                 if ( !calendar.isIso8601() )
                 {
-                    period.setUid( IdentifiableObjectUtils.getLocalPeriodIdentifier( period, calendar ) );
+                    period.setUid( getLocalPeriodIdentifier( period, calendar ) );
                 }
             }