esmero / webform_strawberryfield

Provides Webform integrations to feed a field of Strawberries. Mr. Wizard of WebOz
GNU Lesser General Public License v3.0
2 stars 6 forks source link

When converting on the fly Objects to multi objects array we are not doing it right (webform widget) #155

Closed DiegoPino closed 1 year ago

DiegoPino commented 1 year ago

What?

To avoid the Webform issues that: A) you have a singe value entry in your JSON. e.g

"property": "hola"

and your webform says that "property" webform element is multiple we convert on the fly/on load "property": "hola" to

"property":[ "hola" ]

But the same logic does not work for

"property": {"a":1} because we are decoding the JSON as an associative array which means "property" is already an array and ends being again "property": {"a":1} instead of "property": [{"a":1}] which is what we need

DiegoPino commented 1 year ago

@alliomeria pingggg

DiegoPino commented 1 year ago

Solved via https://github.com/esmero/webform_strawberryfield/commit/f78b6ca3f3c13c92d0903225affab69c46a8c161