Hi,

I have got this warning in taxonomy term pages

Strict warning: Only variables should be passed by reference in metatag_views_post_render() (linea 1342 di sites\all\modules\metatag\metatag.module).

The problem seems to be the function array_pop. Array_pop expects an array variable by reference.

I modified line 1342 of metatag.module

$entity = array_pop(entity_load($entity_name, $view->args));

In

$entity = entity_load($entity_name, $view->args);
$entity = array_pop($entity);

And now works fine, is this the right way?
I hope this will be helpful.

CommentFileSizeAuthor
#2 metatag-n1840402.patch719 bytesDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NStorm’s picture

I've also encountered that warning after updating meta tags from 7.x-1.0-beta1 to beta2
Strict warning: Only variables should be passed by reference in function metatag_views_post_render() (line 1342 in sites/all/modules/metatag/metatag.module).
This warning is generated and shown every time I'm trying to open any tag (taxonomy term) url.
It was perfectly fine before update to beta2. Reverting back to beta1 fixes the warning.
This error is only shown when php has E_STRICT enabled in error_reporting.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
719 bytes

One of those should have known better errors. Doh!

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

paperdhc’s picture

Great, thanks!

DamienMcKenna’s picture

Version 7.x-1.0-beta3 has been released and includes this work. Am closing this issue in an effort to keep the issue queue clean. Thank you all for your continued help!

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)