Problem/Motivation

Having used metatag for several years, on multiple sites, without issue, somewhere in early December, one of my sites broke. We noticed following a Semrush audit that showed the site had no sensible metatags. On review, we identified that when attempting to edit metatags, all of the entries in:
- admin/config/search/metatags/config/

...showed as unknown (see image 1). We uninstalled and reinstalled the module, which restored sensible ("Global") naming, however after navigating to other parts of the site, at some (seemingly random) point this reverts back to unknown.

Further, if we attempt to edit the homepage settings:
admin/config/search/metatags/config/global%3Afrontpage

...we get: "The website encountered an unexpected error. Please try again later."

Steps to reproduce

This is difficult, because I don't know how it happened and can find very little by way of error logs.
I have multiple sites running on this server that are all working ok, so I don't believe it's a server issue.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

andylarks created an issue. See original summary.

damienmckenna’s picture

Category: Bug report » Support request

Please check the settings page to make sure that Metatag wasn't disabled for all entities and entity bundles, see if that helps.

andylarks’s picture

Thanks @DamianMcKenna

The Settings page shows plenty of ticks, so I don't think that's it :(

A.

thejimbirch’s picture

Status: Active » Needs review

When you:

Further, if we attempt to edit the homepage settings:
admin/config/search/metatags/config/global%3Afrontpage

...we get: "The website encountered an unexpected error. Please try again later."

Go to the logs at /admin/reports/dblog immediately after and you will get more information on the error.

vincent_jo’s picture

StatusFileSize
new51.21 KB

Hi,
same issue here.

It turned from "unknown" back by flushing drush cache, but there´s a yellow background and message: No overridden default meta tags on every single item (see attachment). No dblog entries after clicking edit/override.

The server admin did recently a PHP update to 7.3. Drupal 7.78, metatag 7.x-1.27

After recent drupal core update I noticed a message at /status that "The Fast Token Browser module, The Schema.org Metatag module and The Imagecache Token module are recommended."
I´ve installed them. After a week or so, I have got this issue. Disabling these three sub-modules didn´t really help. At first it looked so as metatags where back, but after some flush caches the same story again ...

any hint?

regards
Vincent

daniel_rempe’s picture

StatusFileSize
new97.64 KB
new41.48 KB
new69.62 KB

I could see the same behavior at a clients site.
- Recently a PHP update to 7.3, Drupal 7.80, metatag 7.x-1.27
- Clearing the cache resolves the issue temporarily.
- Message about invalite token is shown.

I suspect the error in the entity type discovery and how it is handled in the cache.

damienmckenna’s picture

Status: Needs review » Postponed (maintainer needs more info)

Going to need further details to determine if it's a problem in Metatag, it's likely being caused by custom code somewhere.

techdude’s picture

I am seeing this issue on just one of my sites right now. All metatags switched to Unknown as shown in the screenshot posted in #6 above. I'm running Core 7.82 and PHP 7.2.34. No known changes were made on our end, but suddenly the issue appeared. I am not seeing the error on a different, nearly identical site. Clearing the cache has resolved the problem, but it remains to be seen how long that will last per #6 reporting it worked only temporarily for them. If I can locate further details, I will be sure to share them here, but I thought I'd at least share our observations with the issue so far.

aww’s picture

May 2022

This problem persists with Metatag.

Metatag 1.28
Token 1.9
Drupal 7.89
PHP 7.4.3

Log Message:

Type php

Date Wednesday, May 25, 2022 - 4:45pm

Message TypeError: Argument 3 passed to metatag_metatags_form() must be of the type array, null given, called in /var/www/html/httpdocs/sites/all/modules/metatag/metatag.admin.inc on line 292 in metatag_metatags_form() (line 1492 of /var/www/html/httpdocs/sites/all/modules/metatag/metatag.module).

Severity error

pamelalies’s picture

I was trying to track down this issue with disappearing metatags for a couple of months, and I finally found the solution for our sites! I thought I would post it here in case anyone else might have the same root cause - because it wasn't an easy one to track down.

This issue also broke all site tokens, so it was messing up lots of things - anywhere tokens were used on the sites. It was causing blank webform submission emails to be sent (because the data is fed into the emails via tokens), and several other nasty things.

I know a lot of people mentioned that it started happening after upgrading PHP to 7.3 or 7.4. In our case the problem was caused by the Colorfield module, which has some of the "curly braces" code, which is deprecated in PHP 7.4.

I applied this patch to our installed Colorfield module, and it fixed this issue that's been plaguing us.

https://www.drupal.org/project/colorfield/issues/3163653

You wouldn't think that a module throwing a warning would break so many other things, but in this case it did. If this isn't your exact problem, you might try fixing any other curly braces deprecations in any other modules you might have installed and see if it helps you as it did us.

rod-on’s picture

I also got an error: "The website encountered an unexpected error. Please try again later."
Rollback from version 7.x-1.30 to version metatag 7.x-1.28 helped

damienmckenna’s picture

@rod-on: Please use the WSOD instructions to work out the cause of that problem, if it is a problem with Metatag please check the issue queue to see if a bug report already exists for the problem, otherwise please open a new bug report. Thank you.

ahmed.raza’s picture

Hi I am facing the exact same issue where all the site tokens are messed up and also the metatag module page is showing all these metatags in pale yellow background. Previously they were all "Unknown" I cleared the caches and alteast their names came back but when I go ahead and edit any of these their entire form is gone and only "Save" and "Cancel" buttons are available. On admin/config/search/metatags/settings page all the checkboxes are checked for the relevant entity types and settings save without issues.

Metatag module version: 7.x-2.1
Drupal: 7.98
PHP: 8.1

damienmckenna’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I thank you for your contribution to the Metatag module and the Drupal community as a whole. The D7 version of this module is no longer supported, so I am closing this issue.

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.