Hi,

I have installed the latest version 7.x-1.2 and while everything seems to be working well, a php warning is generated on all pages of the site. The warning message is as follows:

Strict warning: Only variables should be passed by reference in drupalforfirebug_get_php_exec() (line 273 of /var/www/sandbox-d7/sites/all/modules/drupalforfirebug/drupalforfirebug.module).

I have looked into the offending script on and around line 273 but could not nail it down. I am somewhat familiar with the conditions that might trigger this warning but was not able to readily see the problem in this code. I am hoping someone can quickly let me know how to make this warning go away.

Thanks

-Reuben

CommentFileSizeAuthor
#2 drupalforfirebug.module.patch579 bytesesod

Comments

Anonymous’s picture

Hello,

I got the same error on another module I was trying out, and the solution found for it was to split the function into two calls. So in this case, on line 273 in file drupalforfirebug.module I get this:

$output .= drupal_render(drupal_get_form('drupalforfirebug_execute_form'));

and it generates the error mentionned, so I just splitted to get:

$dff_exec_form = drupal_get_form('drupalforfirebug_execute_form');
$output .= drupal_render($dff_exec_form);

and the error is gone... Since I'm new into php coding, I cannot explain why is this so, maybe someone has a better way to solve this.

Hope it helps.

esod’s picture

Status: Active » Needs review
StatusFileSize
new579 bytes

bucketride's suggestion works for me too. I've attached the patch. Thanks.

frank ralf’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies ok and gets rid of the error message. Thanks! Setting this to reviewed & tested.

drupal_render(&$elements) requires an array passed by reference, whereas drupal_get_form($form_id) returns a literal array from a function call. That might trigger the error message but shouldn't have any other effect.

Daniel_KM’s picture

Hi,

Thanks for the patch. I hope it will be committed soon.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

frob’s picture

Assigned: Unassigned » frob
frob’s picture

Status: Reviewed & tested by the community » Closed (fixed)

This has been rolled into the dev branch, after a few more of these issues are cleared we will roll out a new minor release.

frob’s picture

Status: Closed (fixed) » Fixed
frank ralf’s picture

Thanks!

Status: Fixed » Closed (fixed)

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

bfr’s picture

For those who are interested, this is a bug in Drupal core handling some stricts incorrectly. The way you fixed it is exactly the suggested way of dealing with it.