Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | metatag-n1840402.patch | 719 bytes | DamienMcKenna |
Comments
Comment #1
NStorm CreditAttribution: NStorm commentedI'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.
Comment #2
DamienMcKennaOne of those should have known better errors. Doh!
Comment #3
DamienMcKennaCommitted.
Comment #4
paperdhc CreditAttribution: paperdhc commentedGreat, thanks!
Comment #5
DamienMcKennaVersion 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!
Comment #6
DamienMcKenna