← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11200: Fixed minor bug, not setting current format for data entry forms when saving

 

------------------------------------------------------------
revno: 11200
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-06-11 21:20:08 +0200
message:
  Fixed minor bug, not setting current format for data entry forms when saving
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/hibernate/HibernateDataEntryFormStore.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/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2013-03-01 10:18:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2013-06-11 19:20:08 +0000
@@ -66,15 +66,12 @@
     extends BaseNameableObject
 {
     public static final String TYPE_DEFAULT = "default";
-
     public static final String TYPE_SECTION = "section";
-
     public static final String TYPE_CUSTOM = "custom";
-
     public static final String TYPE_SECTION_MULTIORG = "multiorg_section";
 
     public static final int NO_EXPIRY = 0;
-
+    
     /**
      * Determines if a de-serialized file is compatible with this class.
      */

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/hibernate/HibernateDataEntryFormStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/hibernate/HibernateDataEntryFormStore.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/hibernate/HibernateDataEntryFormStore.java	2013-06-11 19:20:08 +0000
@@ -64,6 +64,11 @@
 
     public int addDataEntryForm( DataEntryForm dataEntryForm )
     {
+        if ( dataEntryForm != null )
+        {
+            dataEntryForm.setFormat( DataEntryForm.CURRENT_FORMAT );
+        }
+        
         Session session = sessionFactory.getCurrentSession();
 
         return (Integer) session.save( dataEntryForm );