← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13236: Minor

 

------------------------------------------------------------
revno: 13236
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-12-14 16:01:19 +0100
message:
  Minor
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.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-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java	2013-12-14 14:47:45 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java	2013-12-14 15:01:19 +0000
@@ -83,7 +83,7 @@
     
     @PreAuthorize("hasRole('ALL') or hasRole('F_DATAVALUE_ADD')")
     @RequestMapping( method = RequestMethod.POST, produces = "text/plain" )
-    public void saveDataValue( @RequestParam String de, @RequestParam String co, 
+    public void saveDataValue( @RequestParam String de, @RequestParam(required=false) String co, 
         @RequestParam String pe, @RequestParam String ou, 
         @RequestParam(required=false) String value, @RequestParam(required=false) String comment,
         @RequestParam(required=false) boolean followUp, HttpServletResponse response )
@@ -96,7 +96,16 @@
             return;
         }
         
-        DataElementCategoryOptionCombo categoryOptionCombo = categoryService.getDataElementCategoryOptionCombo( co );
+        DataElementCategoryOptionCombo categoryOptionCombo = null;
+        
+        if ( co == null )
+        {
+            categoryOptionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
+        }
+        else
+        {
+            categoryOptionCombo = categoryService.getDataElementCategoryOptionCombo( co );
+        }
         
         if ( categoryOptionCombo == null )
         {