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

Repeat is not shown in hierarchy view if first instance has no relevant content #4570

Closed
lognaturel opened this issue May 21, 2021 · 6 comments · Fixed by #4762
Closed

Repeat is not shown in hierarchy view if first instance has no relevant content #4570

lognaturel opened this issue May 21, 2021 · 6 comments · Fixed by #4762

Comments

@lognaturel
Copy link
Member

Software and hardware versions

Collect v1.30.1

Problem description

Repeat is not shown in hierarchy view if first instance has no relevant content

Steps to reproduce the problem

See this form. Select 'beans', see that the repeat is shown in the hierarchy view. Select some other vegetables but not 'beans' and see that the repeat is not shown.

Expected behavior

The repeat should be shown even if its first instance has no relevant content. This is related to another issue I know we've discussed where if there are no instances of a repeat yet, it doesn't show in the hierarchy view. It might make sense to fix both and always show a repeat if there is one in the body.

@dimwight
Copy link
Contributor

Took an initial look at this, partly as a way of getting to grips with repeats. The trouble seems to start in FormHierarchyActivity.refreshView on entry to the switch case EVENT_GROUP, where FormController.isGroupRelevant returns false. So maybe a Javarosa issue?

@dimwight
Copy link
Contributor

Actually not, there seems to be a trivial fix in FormHierarchyActivity.refreshView. Working on a PR.

dimwight added a commit to dimwight/collect that referenced this issue Jul 30, 2021
dimwight added a commit to dimwight/collect that referenced this issue Jul 30, 2021
dimwight added a commit to dimwight/collect that referenced this issue Jul 30, 2021
@seadowg
Copy link
Member

seadowg commented Sep 6, 2021

@dimwight I'm trying to dig into the issue here and thought you might have already covered the same tracks. Why is it that selecting "Beans" in the attached form works and selecting other veg doesn't? As far as I can see the repeat has "relevant content" no matter what kind of veg is selected.

@dimwight
Copy link
Contributor

@seadowg do you have time to review my explanation added to #4762 about a week ago? I had hoped this would make clear what seems to be going on and why my proposed fix works.

@seadowg
Copy link
Member

seadowg commented Sep 22, 2021

Sorry for the delay @dimwight. I'll hopefully be able to take a look within the next couple of days.

@seadowg
Copy link
Member

seadowg commented Sep 27, 2021

I've managed to create a simpler form that seems to demonstrate the problem: https://docs.google.com/spreadsheets/d/11WQI3IpKuqLAaoU-djxOyIxTuED10IFqKBlta_dL7Q0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants