Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I was working with the metatags on and the panels module, checked "Enable Metatag configuration" and clicked update and save without entering any metatags. I got a slew of notice level errors. I traced the notices down to this line (#97)
$name = "metatag:" . $options["instance"] . ":" . $this->info["name"];
The error can be removed with this replacement line...
$name = "metatag:" . (isset($options["instance"]) ? $options["instance"] : '') . ":" . $this->info["name"];
This doesn't necessarily fix the issue of instance not being set when this function is called, but it does suppress the notice error. The behavior of the code will be the same before and after - when PHP is asked to add a null or unset value to a string, it adds an empty value instead.
Comment | File | Size | Author |
---|---|---|---|
metatag_notice.patch | 592 bytes | Aki Tendo | |
Comments
Comment #1
DamienMcKennaComment #2
DamienMcKennaThanks for the patch.
FYI please change the issue status to "Needs review" when you upload a patch, that tells the maintainer that you have a potential solution available, and triggers the automated tests to help check whether the patch will work.
Comment #4
DamienMcKennaNeeds to be rerolled.
Comment #5
DamienMcKennaThis was fixed in #1994634: DrupalTextMetaTag::getValue() defaults to not having $options['instance'] but expects it.