From 972034d6aa2ba6677e4da9b65e2f924f6ff4a195 Mon Sep 17 00:00:00 2001 From: Shubham Goyal Date: Thu, 14 Sep 2023 05:44:23 -0500 Subject: [PATCH] Fix backward compatibility for old serialised app db states --- src/main/java/org/commcare/suite/model/StackFrameStep.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/commcare/suite/model/StackFrameStep.java b/src/main/java/org/commcare/suite/model/StackFrameStep.java index 730cd86b8..ec7d52959 100644 --- a/src/main/java/org/commcare/suite/model/StackFrameStep.java +++ b/src/main/java/org/commcare/suite/model/StackFrameStep.java @@ -218,6 +218,10 @@ public StackFrameStep defineStep(EvaluationContext ec, SessionDatum neededDatum) extras.forEach((key, value) -> { if (value instanceof QueryData) { defined.addExtra(key, ((QueryData)value).getValues(ec)); + } else if (value instanceof XPathExpression) { + // only to maintain backward compatibility with old serialised app db state, can be removed in + // subsequent deploys + defined.addExtra(key, FunctionUtils.toString(((XPathExpression)value).eval(ec))); } else { throw new RuntimeException("Invalid data type for step extra " + key); }