Check if container items are arrays and convert if not by nolanpro · Pull Request #2813 · ProcessMaker/processmaker · GitHub
Skip to content

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

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

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

Conversation

@nolanpro

@nolanpro nolanpro commented Feb 3, 2020

Copy link
Copy Markdown
Contributor

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

velkymx commented Feb 5, 2020

Copy link
Copy Markdown
Contributor

@nolanpro

nolanpro commented Feb 5, 2020

Copy link
Copy Markdown
Contributor Author

@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