← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11516: Fix bug - Errow when setting default values for fixed-attribute values in custom registration form.

 

------------------------------------------------------------
revno: 11516
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-07-25 15:50:25 +0700
message:
  Fix bug - Errow when setting default values for fixed-attribute values in custom registration form.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationFormService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.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/patient/PatientRegistrationFormService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationFormService.java	2013-07-02 02:25:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationFormService.java	2013-07-25 08:50:25 +0000
@@ -58,7 +58,7 @@
 
     final Pattern TITLE_TAG_PATTERN = Pattern.compile( "title=\"(.*?)\"", Pattern.DOTALL );
 
-    final Pattern SUGGESTED_VALUE_PATTERN = Pattern.compile( "suggested='(\\w*)'" );
+    final Pattern SUGGESTED_VALUE_PATTERN = Pattern.compile( "suggested=('|\")(\\w*)('|\")" );
     
     final Pattern CLASS_PATTERN = Pattern.compile( "class='(\\w*)'" );
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java	2013-07-25 07:39:24 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java	2013-07-25 08:50:25 +0000
@@ -193,7 +193,7 @@
                 }
                 else if( suggestedMarcher.find())
                 {
-                    value = suggestedMarcher.group( 1 );
+                    value = suggestedMarcher.group( 2 );
                 }
                 
                 if( classMarcher.find() )