Skip to content

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

Merged
velkymx merged 1 commit intodevelopfrom
feature/2812
Feb 6, 2020
Merged

Check if container items are arrays and convert if not#2813
velkymx merged 1 commit intodevelopfrom
feature/2812

Conversation

@nolanpro
Copy link
Copy Markdown
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
Copy Markdown
Contributor

velkymx commented Feb 5, 2020

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

@nolanpro
Copy link
Copy Markdown
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