← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2883: Thrown exception when adding/updating ProgramStage object.

 

------------------------------------------------------------
revno: 2883
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-02-21 11:00:27 +0700
message:
  Thrown exception when adding/updating ProgramStage object.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.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-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java	2010-10-20 07:16:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java	2011-02-21 04:00:27 +0000
@@ -111,9 +111,9 @@
         this.description = description;
     }
 
-    private int minDaysFromStart;
+    private Integer minDaysFromStart;
 
-    public void setMinDaysFromStart( int minDaysFromStart )
+    public void setMinDaysFromStart( Integer minDaysFromStart )
     {
         this.minDaysFromStart = minDaysFromStart;
     }
@@ -147,6 +147,7 @@
         programStage.setProgram( program );
         programStage.setName( name );
         programStage.setDescription( description );
+        minDaysFromStart = (minDaysFromStart == null ) ? 0 : minDaysFromStart;
         programStage.setMinDaysFromStart( minDaysFromStart );
 
         programStageService.saveProgramStage( programStage );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java	2010-10-20 07:16:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java	2011-02-21 04:00:27 +0000
@@ -99,9 +99,9 @@
         this.description = description;
     }
 
-    private int minDaysFromStart;
+    private Integer minDaysFromStart;
 
-    public void setMinDaysFromStart( int minDaysFromStart )
+    public void setMinDaysFromStart( Integer minDaysFromStart )
     {
         this.minDaysFromStart = minDaysFromStart;
     }
@@ -133,6 +133,7 @@
 
         programStage.setDescription( description );
 
+        minDaysFromStart = (minDaysFromStart == null ) ? 0 : minDaysFromStart;
         programStage.setMinDaysFromStart( minDaysFromStart );
 
         programStageService.updateProgramStage( programStage );