Problem/Motivation

We're seeing a a PHP 8.1 deprecation message when translating content with an empty metatag field.

#2 web/modules/contrib/tmgmt/sources/content/src/MetatagsFieldProcessor.php(19): unserialize(NULL)\n
#3 web/modules/contrib/tmgmt/sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php(275): Drupal\tmgmt_content\MetatagsFieldProcessor->extractTranslatableData(Object(Drupal\metatag\Plugin\Field\FieldType\MetatagFieldItemList))\n

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB
new1.65 KB
berdir’s picture

Thought the test doesn't work, but it results in a suppressed deprecation message, not an error:

Unsilenced deprecation notices (1)

  1x: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated
    1x in ContentEntityMetatagTest::testMetatagsField from Drupal\Tests\tmgmt_content\Kernel

Including a test fix for Drupal 9.4

  • Berdir committed cf45cac on 8.x-1.x
    Issue #3277425 by Berdir: PHP 8.1 compatiblity in metatag integration,...
berdir’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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