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

Closed
tuxpiper opened this issue Aug 28, 2019 · 0 comments
Labels
Bug Codebase: API Indicates issue work will be in API
Milestone

Comments

@tuxpiper
Copy link
Member

tuxpiper 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.
No

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.

Aha! Link: https://ushahiditeam.aha.io/features/PROD-183

@tuxpiper tuxpiper added Bug Codebase: API Indicates issue work will be in 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
@rowasc rowasc added this to the Parking Lot milestone Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Codebase: API Indicates issue work will be in API
Projects
None yet
Development

No branches or pull requests

3 participants