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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

carolpettirossi created an issue. See original summary.

carolpettirossi’s picture

Here's a patch to solve this issue

jrockowitz’s picture

Let'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.

jrockowitz’s picture

  • jrockowitz authored 4a5f759 on 8.x-5.x
    Issue #3170148 by jrockowitz, carolpettirossi: Running drush updb throws...
jrockowitz’s picture

Status: Active » Fixed

  • jrockowitz authored 4a5f759 on 6.x
    Issue #3170148 by jrockowitz, carolpettirossi: Running drush updb throws...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.