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

GET post/:id is always returning empty `completed_stages` for stages that are internal use only #3674

tuxpiper opened this issue Aug 28, 2019 · 0 comments


Copy link

commented Aug 28, 2019

Describe the bug
On the API, when obtaining posts with stages that are marked for internal use only, those stages are never shown as completed.

Where was the bug observed
All current API deployments.

To Reproduce
Steps to reproduce the behavior:

As admin / post manager:

  1. Create survey with stages that are for internal use only
  2. Create post for the newly created survey
  3. Mark the internal use stages as complete
  4. Retrieve your post
  5. Observe how internal use stages are not marked complete

Expected behavior
Internal use stages should appear as complete to

Is there a workaround? What is it.

Additional context
Looking at the fixtures we use in the API integration tests, none of the survey stages defined there are marked as internal use only. This would explain why this problem is not making tests fail.

This is what I suspect to be the root of the problem:

$excludeStages = $this->form_stage_repo->getHiddenStageIds(
. This operation is done without checking the user permissions , and the resulting value is later on used to filter out which stages are reported as complete.

@tuxpiper tuxpiper added Bug API labels Aug 28, 2019

@tuxpiper tuxpiper changed the title GET post/:id is always returning empty `completed_stages` field GET post/:id is always returning empty `completed_stages` for stages that are internal use only Aug 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.