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

Fixes form navigation error due to multiple search callout extras #2867

Merged
merged 1 commit into from
Oct 22, 2024
Merged
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
6 changes: 5 additions & 1 deletion app/src/org/commcare/adapters/EntityListAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.commcare.cases.entity.NodeEntityFactory;
import org.commcare.dalvik.R;
import org.commcare.interfaces.AndroidSortableEntityAdapter;
import org.commcare.modern.session.SessionWrapper;
import org.commcare.preferences.MainConfigurablePreferences;
import org.commcare.session.SessionInstanceBuilder;
import org.commcare.suite.model.Action;
Expand Down Expand Up @@ -429,7 +430,10 @@ public void loadCalloutDataFromSession() {

public void saveCalloutDataToSession() {
if (isFilteringByCalloutResult) {
CommCareApplication.instance().getCurrentSession().addExtraToCurrentFrameStep(SessionInstanceBuilder.KEY_ENTITY_LIST_EXTRA_DATA, calloutResponseData);
SessionWrapper session = CommCareApplication.instance().getCurrentSession();
session.removeExtraFromCurrentFrameStep(SessionInstanceBuilder.KEY_ENTITY_LIST_EXTRA_DATA);
session.addExtraToCurrentFrameStep(SessionInstanceBuilder.KEY_ENTITY_LIST_EXTRA_DATA,
Comment on lines +434 to +435
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that the caller needs to know that they need to remove the extra first in order to add another. Why not leave the removal to the addExtraTopStep and addExtra.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong thoughts but I think it's best for caller to decide depending on whether the calling implementation expects duplicate extras or not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, got it.

calloutResponseData);
}
}

Expand Down