Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Duplicate ]fix query step extras to not have a list of list #1407

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/commcare/suite/model/StackFrameStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public StackFrameStep defineStep(EvaluationContext ec, SessionDatum neededDatum)
StackFrameStep defined = new StackFrameStep(elementType, id, evaluateValue(ec));
extras.forEach((key, value) -> {
if (value instanceof QueryData) {
defined.addExtra(key, ((QueryData)value).getValues(ec));
defined.getExtras().putAll(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ public void stackWithQueries() throws Exception {
StackFrameStep queryFrame = steps.get(2);
assertEquals(SessionFrame.STATE_QUERY_REQUEST, queryFrame.getElementType());

ImmutableMultimap.Builder<String, ImmutableList> builder = ImmutableMultimap.builder();
builder.put("case_type", ImmutableList.of("patient"));
builder.put("x_commcare_data_registry", ImmutableList.of("test"));
builder.put("case_id", ImmutableList.of("case_one"));
builder.put("case_id", ImmutableList.of("dupe1"));
ImmutableMultimap.Builder<String, String> builder = ImmutableMultimap.builder();
builder.put("case_type", "patient");
builder.put("x_commcare_data_registry", "test");
builder.putAll("case_id", ImmutableList.of("case_one", "dupe1"));
assertEquals(builder.build(), queryFrame.getExtras());
}
}
Loading