Problem/Motivation

PHP 8.4 deprecates implicitly marking parameters as nullable. A fresh install of metatag results in deprecation warnings like this:

Deprecated: Drupal\metatag\MetatagToken::replace(): Implicitly marking parameter $bubbleable_metadata as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagToken.php on line 60

Deprecated: Drupal\metatag\MetatagManager::form(): Implicitly marking parameter $included_groups as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 327

Deprecated: Drupal\metatag\MetatagManager::form(): Implicitly marking parameter $included_tags as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 327

Deprecated: Drupal\metatag\MetatagManager::getDefaultMetatags(): Implicitly marking parameter $entity as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 458

Deprecated: Drupal\metatag\MetatagManager::generateRawElements(): Implicitly marking parameter $cache as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/metatag/src/MetatagManager.php on line 582

This is fixed by the latest Drupal coding standards, but the phpcs issue for this module is stalled (#3484975: Resolve phpcs issues), so I'm creating a fix for only the nullable deprecation warning here.

CommentFileSizeAuthor
#6 metatag-163.patch6.87 KBklausi

Issue fork metatag-3490807

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Status: Active » Needs review
nickdickinsonwilde’s picture

Status: Needs review » Reviewed & tested by the community

working for me, thanks

damienmckenna’s picture

klausi’s picture

StatusFileSize
new6.87 KB

Thank you! Here is the patch file for composer patches.

@damienmckenna can you merge and make a new release?

damienmckenna’s picture

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you all.

Status: Fixed » Closed (fixed)

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