- Issue created by @mortim07
When attempting to update a webform element programatically that is either a composite element or contains a composite element, we're receiving the following error "Object support when dumping a YAML file has been disabled."
- Create a webform
- Add a composite element to it and save
- Create a Drush script or an update hook
- Load the webform using its ID.
- Get the element using getElement and its machine name
- Change one of the elements properties
- Call setElementProperties using its key and the modified element
- Error is produced
The error seems to stem from composite elements where the TranslatableMarkup class has been used as part of its properties definition in the getCompositeElements method. When attempting to dump the array in the WebformYaml class, objects are not allowed and therefore an error is produced.
Not sure what the resolution is aside from not using TranslatableMarkup in the getCompositeElements method or recursively converting them to be strings prior to dumping?
Active
6.3
Code