From 0f0e3a3cc0cb19a55f8f388fd345fb510d37a0e0 Mon Sep 17 00:00:00 2001 From: nivetha Date: Wed, 20 Apr 2022 11:58:22 +0530 Subject: [PATCH 1/2] content progress fix --- .../scala/org/sunbird/enrolments/ContentConsumptionActor.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala b/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala index bb0376a27..38c7b09b1 100644 --- a/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala +++ b/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala @@ -376,7 +376,7 @@ class ContentConsumptionActor @Inject() extends BaseEnrolmentActor { ProjectUtil.removeUnwantedFields(m, JsonKey.DATE_TIME, JsonKey.USER_ID, JsonKey.ADDED_BY, JsonKey.LAST_UPDATED_TIME, JsonKey.OLD_LAST_ACCESS_TIME, JsonKey.OLD_LAST_UPDATED_TIME, JsonKey.OLD_LAST_COMPLETED_TIME) m.put(JsonKey.COLLECTION_ID, m.getOrDefault(JsonKey.COURSE_ID, "")) jsonFields.foreach(field => - if(fields.contains(field)) + if(fields.contains(field) && m.get(field) != null) m.put(field, mapper.readTree((m.getOrDefault(field, "")).asInstanceOf[String])) ) val formattedMap = JsonUtil.convertWithDateFormat(m, classOf[util.Map[String, Object]], dateFormatter) From f86b136cd744961eed4977f5840c5421a34bd1eb Mon Sep 17 00:00:00 2001 From: nivetha Date: Wed, 20 Apr 2022 12:04:05 +0530 Subject: [PATCH 2/2] content progress fix --- .../scala/org/sunbird/enrolments/ContentConsumptionActor.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala b/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala index 38c7b09b1..132cc3c99 100644 --- a/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala +++ b/course-mw/enrolment-actor/src/main/scala/org/sunbird/enrolments/ContentConsumptionActor.scala @@ -377,7 +377,7 @@ class ContentConsumptionActor @Inject() extends BaseEnrolmentActor { m.put(JsonKey.COLLECTION_ID, m.getOrDefault(JsonKey.COURSE_ID, "")) jsonFields.foreach(field => if(fields.contains(field) && m.get(field) != null) - m.put(field, mapper.readTree((m.getOrDefault(field, "")).asInstanceOf[String])) + m.put(field, mapper.readTree(m.get(field).asInstanceOf[String])) ) val formattedMap = JsonUtil.convertWithDateFormat(m, classOf[util.Map[String, Object]], dateFormatter) if (fields.contains(JsonKey.ASSESSMENT_SCORE))