Skip to content

Commit

Permalink
Merge pull request #1334 from dimagi/queryDataFix
Browse files Browse the repository at this point in the history
Fix backward compatibility for Stack Query Datum
  • Loading branch information
shubham1g5 authored Sep 14, 2023
2 parents 7aea837 + 972034d commit d37dabb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/commcare/suite/model/StackFrameStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d37dabb

Please sign in to comment.