Fixed
Project:
Metatag
Version:
2.2.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Oct 2026 at 21:27 UTC
Updated:
30 Oct 2026 at 10:15 UTC
Jump to comment: Most recent
When accessing the Metatag defaults administration page, a fatal error is triggered preventing the page from rendering. This is on updating to version 2.2.3 on Drupal 11.4.11.
Navigate to the Metatag configurations/defaults page /admin/config/search/metatag). Error is: Call to a member function addMessage() on null in Drupal\metatag\MetatagDefaultsListBuilder->render() (line 204 of /var/www/html/web/modules/contrib/metatag/src/MetatagDefaultsListBuilder.php).
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
Comment #2
hcksharp commentedComment #3
hcksharp commentedComment #5
wkr1shna commentedComment #7
wkr1shna commentedComment #8
damienmckennaComment #9
damienmckennaI'm not able to reproduce this. Did you rebuild the caches after updating to 2.2.3? I'll be releasing 2.2.4 shortly.
Comment #10
hcksharp commented@damienmckenna if I take the site out of maintenance mode I can access the admin/config/search/metatag. In maintenance mode it crashes the metatag admin page with the fatal error.
If I update the line 204 from
"$this->messenger->addMessageto$this->messenger()->addMessagemetatag admin page works in and out of maintenance. Looked at a previous version 2.2.0 and see that the line was changed in the newer one.Stack trace:
Comment #11
camhowardI'm having the same issue on both Drupal 10.6.20 and 11.4.11 after updating to Metatag 2.2.4 and rebuilding caches.
When the sites are in Maintenance mode, going to /admin/config/search/metatag results in a WSOD with the message: "The website encountered an unexpected error. Try again later."
The Drupal error log reports the same "Call to a member function addMessage()..." error reported by @hcksharp in the issue summary.
When the sites are not in Maintenance mode, going to /admin/config/search/metatag works fine.
Comment #13
damienmckennaI've confirmed the bug and confirmed the fix - thank you. This will be included in the upcoming 2.2.5 release.
Comment #15
damienmckennaCommitted. Thank you.