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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

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.