Did a forced cache clear and I get this

Recoverable fatal error: Argument 3 passed to metatag_metatags_form() must be of the type array, null given, called in metatag/metatag.admin.inc on line 309 and defined in metatag_metatags_form() (line 952 of metatag/metatag.module).

Comments

mikeytown2’s picture

Config object looks like

stdClass Object (
    [__original_class_name__] => stdClass
    [cid] => 6
    [instance] => node:basic_information
    [config] => NULL
    [table] => metatag_config
    [type] => Normal
    [export_type] => 1
)
mikeytown2’s picture

Looking at the metatag_config table and a serialized null was in the config column.

Anonymous’s picture

running into this problem today while trying to config meta tags on a panels page.

DamienMcKenna’s picture

Status: Active » Postponed (maintainer needs more info)

Please let me know if you're still getting the problem with the latest release.

Anonymous’s picture

Seems okay now. I am able to add Metatags to panels pages and nodes, views, etc.

DamienMcKenna’s picture

Status: Postponed (maintainer needs more info) » Fixed

@trainingcity: Thanks for letting me know!

@mikeytown2: Any update? I'm marking this as fixed as I believe the problem was resolved in a recent release, please reopen it if the problem still persists for you.

mikeytown2’s picture

We're no longer using this module so I can't offer anything at this point.

DamienMcKenna’s picture

@mikeytown2: Out of interest what are you doing instead?

mikeytown2’s picture

The website that was using metatag has slowly turned into a logged in only site; we've since moved our public facing part to a different domain that is rendered with .net.

DamienMcKenna’s picture

Cool, thanks for the update.

Status: Fixed » Closed (fixed)

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

Vaene’s picture

This error is popping up for me when I try to edit the Global Metatag:
Recoverable fatal error: Argument 3 passed to metatag_metatags_form() must be of the type array, null given, called in /Users/.../site/sites/all/modules/metatag/metatag.admin.inc on line 292 and defined in metatag_metatags_form() (line 1322 of /Users/.../site/sites/all/modules/metatag/metatag.module).

cache_metatag has this serialization for ctools_export:metatag_config:global:
O:8:"stdClass":5:{s:8:"instance";s:6:"global";s:11:"api_version";i:1;s:8:"disabled";b:0;s:6:"config";a:4:{s:5:"title";a:1:{s:5:"value";s:54:"[current-page:title] | [current-page:pager][site:name]";}s:9:"generator";a:1:{s:5:"value";s:28:"Drupal 7 (http://drupal.org)";}s:9:"canonical";a:1:{s:5:"value";s:27:"[current-page:url:absolute]";}s:9:"shortlink";a:1:{s:5:"value";s:28:"[current-page:url:unaliased]";}}s:13:"export_module";s:7:"metatag";}

And metatag_config has one row:
cid instance config
1 global N;

We've been having problems with any settings showing up for metatags and with edit failing so I reinstalled metatag to the 7.x-1.17 version. Cleared Cache and manually truncated cache_metatag. In settings to keep things simple I only have metatags enabled for Node -> Basic Page, and in Advanced Settings I turned of load defaults and cache meta tags. Still, whenever I try to edit Global, the page fails with the above error in dblog.

dpm'd config and I see that config=>config is NULL

config =>

... (Object) stdClass
cid (String, 1 characters ) 1
instance (String, 6 characters ) global
config (NULL)
table (String, 14 characters ) metatag_config
type (String, 6 characters ) Normal
export_type (Integer) 1

Guito339’s picture

@DamienMcKenna, @Vaene,

I'm running into this as well (v 7.x-1.17) There is likely something wrong with the data in the metatag_config table, but it's not clear what exactly is wrong and I can't just fix that table on one env and copy it to other envs.... so here is my diagnosis and solution.

Diagnosis
The function function metatag_config_edit_form($form, &$form_state, $config) requires a $config that is passed to: metatag_metatags_form($form, $config->instance, $config->config, $options)

The function function metatag_config_edit_form($form, &$form_state, $config) should probably confirm that $config->$config is set before passing it to metatag_metatags_form($form, $config->instance, $config->config, $options)

If it's not set, then perhaps some sort of helper message should be sent, or some sort of config default should be set.

The way the menu item works is to call metatag_config_load on the 5th argument to the page. so for admin/config/search/metatags/config/node the menu system would pass the result of metatag_config_load('node')

Solution (Not a good one, as it involves hacking a contrib module)
I've used the following code to get around the empty $config in metatag.admin.inc.
Right before the call to metatag_metatags_form($form, $config->instance, $config->config, $options); add

  if (empty($config->config)) {
    $config = metatag_config_load(arg(5));
  }

This will set the config the same way as the menu system would and only changes $config when its empty.

kyuubi’s picture

Hi,
This issue is still occurring for me when using metatag by path.
I just updated to the latest release but it still happens.
Is there any workaround?
Cheers,

DamienMcKenna’s picture

@kyuubi: Please open a new issue and I can help you debug the problem.

kyuubi’s picture

Hi @damienmckenna,
Thanks for the quick reply.
Opened a separate issue here:
https://www.drupal.org/project/metatag/issues/2926375
Thanks so much,
Duarte