Skip to content

Check if container items are arrays and convert if not #2813

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

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

nolanpro
Copy link
Contributor

@nolanpro nolanpro commented Feb 3, 2020

Fixes #2812

Required for ProcessMaker/screen-builder#527

Container items are expected to be nested arrays of items (for Multi Column containers, each column contains an array of items). This is no longer the case with Loop containers. A Loop container is a single array of items. There are a number of validation checks here in core that rely on this nested array structure (I don't know why these checks are not in screen-builder)

The simple solution is to check and see if 'items' is an array, and if it is not, wrap it in a single-item array.

@velkymx
Copy link
Contributor

velkymx commented Feb 5, 2020

@nolanpro What is this PR fixing? Can you add more details?

@nolanpro
Copy link
Contributor Author

nolanpro commented Feb 5, 2020

@velkymx updated the PR description

@velkymx velkymx merged commit 7c6239e into develop Feb 6, 2020
@velkymx velkymx deleted the feature/2812 branch August 10, 2020 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for non-array container items in screen builder
2 participants