Problem/Motivation

Some plugins don't have a description, as example, OgCountryName of metatag_open_graph submodule. When you visit a metatag plugins report page it generates warnings in logs when a site uses php8

Warning: Undefined array key "description" in Drupal\metatag\Controller\MetatagController->reportPlugins() (line 120 of

Steps to reproduce

Use php8, install a metatag_open_graph submodule and visit plugins report page /reports/metatag-plugins

Proposed resolution

Add a description key checking in MetatagController on line 120.

$row['description'] = [
  'data' => [
    '#markup' => isset($definition['description']) ? $definition['description'] : '',
  ],
  'colspan' => 8,
];

And/or add a proper description to all annotations of meta tag plugins.

CommentFileSizeAuthor
#2 metatag-n3265567-2.patch2.91 KBdamienmckenna

Comments

Anatolij Zajika created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
Issue tags: +PHP 8.0
StatusFileSize
new2.91 KB

Does this fix the problem?

pcate’s picture

Status: Needs review » Reviewed & tested by the community

I found this error on the /reports/metatag-plugins page today as well. Patch applies cleanly and removes error.

damienmckenna’s picture

  • DamienMcKenna committed 6631e93 on 8.x-1.x
    Issue #3265567 by DamienMcKenna, Anatolij Zajika, PCate: PHP8 undefined...
damienmckenna’s picture

Title: Php8 undefined array key "description" » PHP8 undefined array key "description"
Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

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