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.

Comments

LittleRedHen’s picture

This suggested patch to theme_biblio_tabular is working for me also (using 7.x-1.0-rc5).

hazit’s picture

Just 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.

liam morland’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new748 bytes

Fix.

cedewey’s picture

Status: Needs review » Reviewed & tested by the community

Patch worked for me. Marking reviewed and tested.

Morasta’s picture

Still 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?

  • rjerome committed 6904e47 on 7.x-1.x authored by Liam Morland
    Issue #1760736 by Liam Morland: Passed by reference error on publication...
rjerome’s picture

Status: Reviewed & tested by the community » Fixed

pushed to -dev

Status: Fixed » Closed (fixed)

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