Strict warning: Only variables should be passed by reference in arrange_fields_display_form() (line 569 of /opt/difang/dev/pjkaixin/sites/all/modules/arrange_fields/arrange_fields.module).
Strict warning: Only variables should be passed by reference in arrange_fields_display_form() (line 585 of /opt/difang/dev/pjkaixin/sites/all/modules/arrange_fields/arrange_fields.module).

when arranging fields.

Comments

richardp’s picture

Hrm-- I'm not exactly sure what I could do to change that. Those lines are both using Drupal 7 built-in functions. Ex:
569: $rtn .= drupal_render(drupal_get_form("arrange_fields_position_form", $form_id, $form_type));

To be fair, you are seeing "strict" warnings. Most production sites don't enable strict warnings. I'm not saying that's any excuse to be a lazy programmer, but usually "strict" is only enabled to help developers catch possible typos and things like that. If you don't think you'd miss them, I'd suggest just reducing your error_reporting level to only show standard warnings and errors.

But at any rate-- I'm not sure what I could do to prevent those, if anything. Anyone else out there have any ideas? Is this me, or Drupal core?

Richard

rogical’s picture

Status: Active » Closed (won't fix)

thanks!

I just adjusted error_reporting, and found the warning information won't record in drupal logs,

so we may just leave this closed.

tedbow’s picture

Status: Closed (won't fix) » Active

@richardp, the problem you are having is that you are passing the return of the function call "drupal_get_form" to drupal_render. drupal_render expects that parameter to be passed by reference. You can only pass a variable by reference NOT the return value of a function call.

Here is an example fix.

$temp_form = drupal_get_form("arrange_fields_position_form", $form_id, $form_type);
 $rtn .= drupal_render($temp_form);

You can apply this to all your drupal_render calls.

richardp’s picture

Oh, interesting. That's what I get for trying to combine too many functions in a row ;)

Thanks, I will try to have that change in my next release!

Richard

richardp’s picture

Version: 7.x-1.0 » 7.x-1.8
Status: Active » Fixed

Okay, this is fixed in the 7.x-1.8 release. Should be avail for download within 10 minutes of this post.

Thanks!
Richard

Status: Fixed » Closed (fixed)

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

kalidasan’s picture

#3 working fine :)

Thanks @tedbow.

Zedda’s picture

Issue summary: View changes

Thanks, @tedbow! I split my variable (with much nail-biting as I am inexperienced with PHP) and did so successfully!