By longwave on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
9.2.x
Introduced in version:
9.2.0
Issue links:
Description:
Configuration exports that contain newlines were previously formatted as one-line strings with escaped newline characters `\n`. This was difficult to read and made diff or merge tools more difficult to use.
Affected configuration exports will now use YAML multiline syntax (but only if they do not contain `\r`, due to YAML limitations). For example:
key: An export\nthat contains\nline breaks
will now be exported as:
key: |
An export
that contains
line breaks
Site builders and module developers should expect changes in their configuration exports. We recommend re-exporting all configuration after updating to this version.
Impacts:
Site builders, administrators, editors
Module developers
Comments
For earlier Drupal versions
Should you want to use this in an earlier version of Drupal on a site managed with composer (made with
drupal-composer/drupal-projectordrupal/recommended-project), you could add"symfony/yaml": "v4.4.21 as 3.4.5"to the project root levelcomposer.jsonand runcomposer update symfony/yaml. Then patchcore/lib/Drupal/Component/Serialization/YamlSymfony.phpand you are done. The API surface of this library is small and the consumers are few so I think going from v3 to v4 should be fine.1c9842d189introducing Symfony v4 didn't need any YAML related changes.See the issue comment #109
See the issue comment #109 for a patch for drupal 8.9 that patches
YamlSymfony.phpas described.This can break certain
This can break certain configuration files that rely on the newline character being correctly represented. For example in my Migrate Plus configuration I have a processor that converts a multiline address from a migration source into an array.
Working migrate plus processor definition (before this change):
Broken migrate plus processor definition (after this change):
Ref. #3244757: Multiline YAML syntax is buggy with single newline character