When i updated the module to the latest dev version, i find a lot of warning messages in the site log:

Notice: Undefined variable: value in metatag_set_preprocess_variable() (row 1110 from /home/www/1dev/sites/all/modules/metatag/metatag.module).

Warning: Missing argument 2 for metatag_set_preprocess_variable() in metatag_set_preprocess_variable() (row 1108 from /home/www/1dev/sites/all/modules/metatag/metatag.module).

Warning: Missing argument 3 for metatag_set_preprocess_variable() in metatag_set_preprocess_variable() (row 1108 from /home/www/1dev/sites/all/modules/metatag/metatag.module).

All forks fine with 7.x-1.0-alpha6+1-dev, but i have a problem only with latest dev and latest stable version.

Comments

damienmckenna’s picture

Only the page title meta tag uses the metatag_set_preprocess_variable function, and it's strange that it wouldn't have a variable. Did you clear your site cache after updating?

sun-fire’s picture

Category: support » bug
Status: Active » Closed (works as designed)

DamienMcKenna, thanks for reply. The problem was into my template file. It was not a module problem.
In my template.php file I use such code to override title for the certain pages based on current path. This is some hackish way, because I override veriable in preprocess_page function:

if (arg(0)=='catalog') {
     $bred_crumb = drupal_get_breadcrumb();
     $crumbs_title = '';
     global $pager_page_array;
     $page_number = '';
     if ($pager_page_array[0]>0) { $page_number = ' - page '. ($pager_page_array[0] + 1); }
     $crumbs_title = strip_tags(implode(' ',$bred_crumb)) . $page_number;
     $variables['page']['content']['metatags']['global']['title']['#attached']['metatag_set_preprocess_variable'][0][2] = $crumbs_title;
     $variables['page']['content']['metatags']['global']['title']['#attached']['metatag_set_preprocess_variable'][1][2] = $crumbs_title;
}

What's the right way to accomplish this with newer version of the module?

sun-fire’s picture

Category: bug » support
damienmckenna’s picture

Category: bug » support

Now that we've a) fixed the per-entity functionality, b) bundled Metatag Context, you shouldn't be hacking templates to do per-page output.