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

Allow Multiple value Webform elements to read single valued JSON #85

Open
DiegoPino opened this issue Jan 5, 2021 · 0 comments
Open
Assignees
Labels
bug Something isn't working enhancement New feature or request Webform Elements Things with input to fill and interact with while ingesting metadata Webform Widgets Connecting Webforms and Entity Fields

Comments

@DiegoPino
Copy link
Member

What?

If you are upgrading/changing your webforms and you want to move from a single valued key, e.g "contributor":"Diego Pino" to a multiple valued "contributor":["Diego Pino", "Allison Lund"] and you update your webform to allow more, the webform element does not know how to read the single valued and stored key. The opposite funny enough works. With the down side that if you have multiple values and you read them via a single valued webform element, on saving you loose the previous/not editable ones. But that is to be expected and can be documented.

What is needed.

We can check which webform elements are multivalued during our widget initialization. Either on the widget itself or via the Controller that allows Ajax/and inline rendering to happen. If a given webform element is setup to be multivalued we cast the corresponding keys to an array. And that is all

If we should inform (log) the operation or not is another topic. Informing the enduser will just lead to confusion but a metadata specialist/in charge of the repo would want to know about this.

This Bug/Feature need was detected by @alliomeria testing RC1 Burt exists since ever, it is the way Webform module deals with value loading for every element and most likely related to the fact that the internal webform submission entity is quite strict. This does never apply to File Upload elements, that logic is written correctly so does not need us to interfere.

@DiegoPino DiegoPino self-assigned this Jan 5, 2021
@DiegoPino DiegoPino added bug Something isn't working enhancement New feature or request Webform Elements Things with input to fill and interact with while ingesting metadata Webform Widgets Connecting Webforms and Entity Fields labels Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Webform Elements Things with input to fill and interact with while ingesting metadata Webform Widgets Connecting Webforms and Entity Fields
Projects
None yet
Development

No branches or pull requests

1 participant