Problem/Motivation

Calls to t() now return a TranslatableMarkup object rather than a string.

In FeaturesManager::initCorePackage() we generate a feature/package name and description through t(), which when exported to the .info.yml file is raising the error:

Drupal\Component\Serialization\Exception\InvalidDataTypeException: Object support when dumping a YAML file has been disabled. in Drupal\Component\Serialization\Yaml::encode() (line 29 of /var/www/drate/core/lib/Drupal/Component/Serialization/Yaml.php).

Proposed resolution

Cast name and description values to strings in FeaturesManager::initCorePackage().

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 features-cast-t-2580591-2.patch626 bytesnedjo

Comments

nedjo created an issue. See original summary.

nedjo’s picture

Status: Active » Needs review
StatusFileSize
new626 bytes

  • nedjo committed faa1b4b on 8.x-3.x
    Issue #2580591 by nedjo: fix error "Object support when dumping a YAML...
nedjo’s picture

Status: Needs review » Fixed

Added a code comment and committed.

  • nedjo committed be5afff on 8.x-3.x
    Issue #2580591: cast strings just before generating Yaml.
    

Status: Fixed » Needs work

The last submitted patch, 2: features-cast-t-2580591-2.patch, failed testing.

nedjo’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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