Hello! :-)

Multiple messages like the one below spawns in the UI when enabling the Forum Access module. No matter which link in the administration menu I open, at least a few lines like below will appear.

Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (line 935 of /var/www/example.com/drupal-7.0-rc1/includes/bootstrap.inc)

Using ACL 7.x-1.0-beta1 and Forum Access 7.x-1.0-apha1 with D7 RC-1. Disabling the Forum Access module removes the error.

Comments

Aonoa’s picture

I just wanted to add that this error does in fact appear at the top of every page on the site after enabling the module. It seems like the module still works while this is popping up, but it's not visually appealing, especially not if I want to use this on a live site.

Aonoa’s picture

I found out that this is the fault of a php.ini configuration setting.

I had "allow_call_time_pass_reference = Off", setting it to "On" solved this issue.

salvis’s picture

Hmm, according to http://php.net/manual/en/ini.core.php this defaults to 1 and it's deprecated.

I have D7 RC1, bootstrap.inc 1.449, but line 935 is

    include_once DRUPAL_ROOT . '/' . $filename;

I can't investigate this any further, but I doubt this is really an FA issue.

Aonoa’s picture

Indeed, I don't know what it might be. This function it mentions will be removed from php in the future, I guess. By allowing the feature to run in php.ini I don't get the message anymore, but if we're certain it's not in FA, we might as well close this issue.

Best regards,
Ao

salvis’s picture

Title: Errors after enabling Forum Access » "Call-time pass-by-reference has been deprecated in drupal_load()" (line 935 of includes/bootstrap.inc)
Status: Active » Closed (won't fix)

Yes, I think at this point there's nothing to do.

Thank you for your feedback.

Heine’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Closed (won't fix) » Active

The error message is rather unhelpful as this error is generated during the forum access include in drupal_load. It is caused by this snippet:

function forum_access_comment_view_alter(&$build) {
// ...
    _forum_access_comment_view_alter(&$build, $tid);
// ...
}
salvis’s picture

Status: Active » Closed (fixed)

Oh! Thanks for putting the finger on it.

Fixed in the -dev version (give it up to 12h to be repackaged).

kjikaqawej’s picture

; This directive allows you to enable and disable warnings which PHP will issue
; if you pass a value by reference at function call time. Passing values by
; reference at function call time is a deprecated feature which will be removed
; from PHP at some point in the near future. The acceptable method for passing a
; value by reference to a function is by declaring the reference in the functions
; definition, not at call time.
This directive does not disable this feature, it
; only determines whether PHP will warn you about it or not. These warnings
; should enabled in development environments only.
; Default Value: On (Suppress warnings)
; Development Value: Off (Issue warnings)
; Production Value: Off (Issue warnings)
; http://php.net/allow-call-time-pass-reference

Thought it might be useful to post the comments ;). (emphasis mine)

Honza Pobořil’s picture

Project: Forum Access » Drupal core
Version: 7.x-1.x-dev » 7.0
Component: Code » base system
Status: Closed (fixed) » Active

Same issue but for different modules. The bug is in core.

Berdir’s picture

Project: Drupal core » Forum Access
Version: 7.0 » 7.x-1.x-dev
Component: base system » Code
Status: Active » Closed (fixed)

No, it is not.

Open a new issue for the module you are experiencing this error. Core is not doing anything wrong.

Honza Pobořil’s picture

Btw, I dont use the Forum Access module.

Heine’s picture

@Bobík, the obvious conclusion is that another contributed module or theme you use tries to pass by ref on call time.

You can find out which module it is by installing devel and enabling its backtrace error handler. The module containing the error should be listed in the backtrace as an argument ($type, $name).

When found, open an issue for the module/theme causing this.

Honza Pobořil’s picture

I updated the Views nodule to the dev version and the errors is out. Thank you for your time :-)

drm’s picture

I started getting this error when moving to a new host. Is there a php setting or parameter that could cause this?

salvis’s picture

No, it depends on your PHP version.

Please update to the latest -dev version, and if the error persists then open a new issue and post the exact error message.