Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm upgrading Drupal 8 to Drupal 9.
If I run updates on Drupal 8 and then go to Drupal 9, the updates work properly. (For example on local env)
However, if I run updates with D9 already then I got the message below:
[error] Argument 1 passed to Symfony\Component\Yaml\Parser::parse() must be of the type string, null given, called in /var/www/html/web/core/lib/Drupal/Component/Serialization/YamlSymfony.php on line 3
This only happens if you have a webform without elements (not common, but possible).
Comment | File | Size | Author |
---|---|---|---|
#4 | webform-6.x-3170148-3.patch | 3.15 KB | jrockowitz |
#4 | webform-8.x-5.x-3170148-3.patch | 3.15 KB | jrockowitz |
#2 | webform-update_error_when_webform_does_not_have_elements-3170148-2.patch | 585 bytes | carolpettirossi |
Comments
Comment #2
carolpettirossi CreditAttribution: carolpettirossi at Prosple commentedHere's a patch to solve this issue
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedLet's use the WebformYaml helper class which handles the empty/null elements array.
I am also update WebformYaml::encode to return an empty string for an empty array.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented