Skip to content

Commit

Permalink
Merge pull request #643 from OpenSRP/fix-overwriting-of-option-key
Browse files Browse the repository at this point in the history
fix overwriting of option key
  • Loading branch information
bennsimon committed Sep 14, 2020
2 parents e748092 + a7f2812 commit 8a6bf9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1,4 +1,4 @@
VERSION_NAME=2.1.1-SNAPSHOT
VERSION_NAME=2.1.2-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Core Application
Expand Down
Expand Up @@ -433,10 +433,6 @@ public static void addObservation(Event e, JSONObject jsonObject) {
continue;
}
if (CONCEPT.equals(entity)) {
// For options with concepts create an observation for each
option.put(AllConstants.TYPE, type);
option.put(AllConstants.PARENT_ENTITY_ID, fieldsOpenmrsEntityId);
option.put(KEY, fieldKey);

if (shouldBeCombined) {
String optionKey = option.optString(KEY);
Expand All @@ -445,6 +441,11 @@ public static void addObservation(Event e, JSONObject jsonObject) {
optionEntityIds.add(optionsOpenmrsEntityId);
continue;
}
// For options with concepts create an observation for each
option.put(AllConstants.TYPE, type);
option.put(AllConstants.PARENT_ENTITY_ID, fieldsOpenmrsEntityId);
option.put(KEY, fieldKey);

createObservation(e, option, String.valueOf(option.getBoolean(VALUE)));
} else {
String optionText = option.optString(AllConstants.TEXT);
Expand Down

0 comments on commit 8a6bf9d

Please sign in to comment.