dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25909
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12870: Configuration, fixed bug, service created new config instead of reusing existing one
------------------------------------------------------------
revno: 12870
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-11-04 14:54:18 +0100
message:
Configuration, fixed bug, service created new config instead of reusing existing one
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.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-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java 2013-11-04 13:54:18 +0000
@@ -54,7 +54,14 @@
@Override
public void setConfiguration( Configuration configuration )
{
- configurationStore.save( configuration );
+ if ( configuration != null && configuration.getId() > 0 )
+ {
+ configurationStore.update( configuration );
+ }
+ else
+ {
+ configurationStore.save( configuration );
+ }
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-10-30 23:36:58 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-11-04 13:54:18 +0000
@@ -889,6 +889,8 @@
executeSql( "alter table reporttable drop column doperiods" );
executeSql( "alter table reporttable drop column dounits" );
executeSql( "alter table reporttable drop column categorycomboid" );
+
+ executeSql( "delete from configuration where configurationid not in (select configurationid from configuration limit 1)" );
}
catch ( Exception ex )
{