Allow Multiple value Webform elements to read single valued JSON #85
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
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.
The text was updated successfully, but these errors were encountered: