The following error appears on rc4 and dev of the 1.x version of biblio when I view a publication:
"Strict warning: Only variables should be passed by reference in theme_biblio_tabular() (line 281 of /var/www/drupal7/sites/all/modules/biblio/includes/biblio_theme.inc)."
Looking at the code the error references, the issue appears to be here:
array('data' => drupal_render(field_view_field('node', $node, 'body', array('label' => 'hidden')))),
if we store the result of field_view_field in a variable and drupal_render that, the error goes away:
$full_text = field_view_field('node', $node, 'body', array('label' => 'hidden'));
$rows[] = array(
array('data' => t('Full Text'), 'valign' => 'top'),
array('data' => drupal_render($full_text)),
);
Is this the best way to fix this error? I am happy to make a patch, but I'm not sure if it is the best way to proceed.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | biblio_1760736_pass_by_reference.patch | 748 bytes | liam morland |
Comments
Comment #1
LittleRedHen commentedThis suggested patch to theme_biblio_tabular is working for me also (using 7.x-1.0-rc5).
Comment #2
hazit commentedJust letting you know that this is still an issue in 7.x-1.0-rc7+0-dev.
These are the errors I am getting:
Strict warning: Only variables should be passed by reference in theme_biblio_tabular() (line 285 of sites\all\modules\biblio\includes\biblio_theme.inc).
Notice: Undefined property: stdClass::$biblio_pubmed_id in altmetric_node_view_alter() (line 35 of sites\all\modules\altmetric\altmetric.module).
About to apply the patch.
Comment #3
liam morlandFix.
Comment #4
cedeweyPatch worked for me. Marking reviewed and tested.
Comment #5
Morasta commentedStill a problem with the latest dev, but manually updating the code worked for me against 7.x-1.0-rc7+10-dev (2014-Nov-11). Any chance at getting this committed?
Comment #7
rjerome commentedpushed to -dev