Problem/Motivation

When running with metatag 2.2.1 the following error occurs:

PHP Fatal error: Declaration of Drupal\external_hreflang\Plugin\metatag\Tag\ExternalHreflang::description(): Drupal\Core\StringTranslation\TranslatableMarkup|string must be compatible with Drupal\metatag\Plugin\metatag\Tag\MetaNameBase::description(): ?Drupal\Core\StringTranslation\TranslatableMarkup in web/modules/contrib/external_hreflang/src/Plugin/metatag/Tag/ExternalHreflang.php on line 83

Steps to reproduce

  1. Install external_hreflang version 2.0.4
  2. Make sure that metatag module version is 2.2.1

Proposed resolution

Update declaration of plugin to allow NULL values

Remaining tasks

Create MR

User interface changes

None

API changes

None

Data model changes

None

Comments

a.dmitriiev created an issue. See original summary.

a.dmitriiev’s picture

It looks like https://www.drupal.org/project/metatag/issues/3398796 had a breaking change updating the typehint of the result of description method from TranslatableMarkup|string and ?TranslatableMarkup and it was done in the patch version 2.2.1.

a.dmitriiev’s picture

Should be fixed in metatag module.

a.dmitriiev’s picture

Status: Active » Closed (works as designed)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.