From 1e8a197a6b831665781e827f90238fcabcc9e6e7 Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 18 Sep 2019 14:46:16 +0300 Subject: [PATCH 1/4] Add native radio key as human readable value when creating observations --- .../src/main/java/org/smartregister/util/JsonFormUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java b/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java index b7d0e8f17..03eca6e92 100644 --- a/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java +++ b/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java @@ -435,6 +435,7 @@ private static void createObservation(Event e, JSONObject jsonObject, String val entityIdVal = getString(jsonObject, OPENMRS_ENTITY_ID); entityParentVal = ""; vall.add(option.getString(OPENMRS_ENTITY_ID)); + humanReadableValues.add(option.getString(KEY)); } } } catch (JSONException e1) { From d098b4203ab62bb8a19ffe811e24e24ef0a3ee76 Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 18 Sep 2019 14:47:40 +0300 Subject: [PATCH 2/4] Upgrade snapshot version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9d85732e4..b2ccc9fb4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=1.7.21-SNAPSHOT +VERSION_NAME=1.7.22-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Core Application From f3d80852416b95d7fc3e13bbf0c4277403f7b00f Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 18 Sep 2019 19:49:46 +0300 Subject: [PATCH 3/4] Check if option has KEY before adding to human readable values list --- .../src/main/java/org/smartregister/util/JsonFormUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java b/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java index 03eca6e92..eafc70fc6 100644 --- a/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java +++ b/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java @@ -435,7 +435,9 @@ private static void createObservation(Event e, JSONObject jsonObject, String val entityIdVal = getString(jsonObject, OPENMRS_ENTITY_ID); entityParentVal = ""; vall.add(option.getString(OPENMRS_ENTITY_ID)); - humanReadableValues.add(option.getString(KEY)); + if (option.has(KEY)) { + humanReadableValues.add(option.getString(KEY)); + } } } } catch (JSONException e1) { From acff22ecb4c889e0e449ea43a4a3530087d81c8f Mon Sep 17 00:00:00 2001 From: Allan O Date: Thu, 19 Sep 2019 11:24:17 +0300 Subject: [PATCH 4/4] Log error using Timber instead of Log --- .../src/main/java/org/smartregister/util/JsonFormUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java b/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java index eafc70fc6..ae39e8138 100644 --- a/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java +++ b/opensrp-app/src/main/java/org/smartregister/util/JsonFormUtils.java @@ -32,6 +32,8 @@ import java.util.Map; import java.util.UUID; +import timber.log.Timber; + /** * Created by keyman on 08/02/2017. */ @@ -441,7 +443,7 @@ private static void createObservation(Event e, JSONObject jsonObject, String val } } } catch (JSONException e1) { - Log.e(TAG, e1.getMessage()); + Timber.e("%s : %s",TAG , e1.getMessage()); } } else { if (values != null && values.length() > 0) {