I am getting multiple errors on user login, like this:

user.login throws "warning: Parameter 2 to MODULE_NAME expected to be a reference, value given in module.inc on line 483."

Tracked it down to the user_services.inc file: it uses module_invoke_all('user','login', NULL, $user) which is incorrect, because call_user_func_array() doesn't properly handle pass by reference with PHP5.3.

The solution is to replace the two module_invoke_all() functions in the user_services.inc with:

user_module_invoke('login', $array = array(), $user);

I'll post a patch when I get a chance, but wanted to get this out here to save others tearing out their hair.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Renee S’s picture

Er, sorry, the user_module_invoke() replacements should name what they're doing, ie user_module_invoke('login... and user_module_invoke('logout =)

gdd’s picture

I would love to get PHP 5.3 patches but I don't currently have an environment to test this stuff on so I havent been dealing with it. So please pass them on. If we can get a confirment working version for PHP 5.3 I think that would be worth rolling a new release.

Renee S’s picture

Status: Needs work » Needs review
FileSize
881 bytes

Patch attached.

Status: Needs review » Needs work

The last submitted patch, user_services-930100.patch, failed testing.

Renee S’s picture

FileSize
875 bytes

mutter mutter eclipse mutter

marcingy’s picture

I really really don't like this - drupal doesn't do this anywhere I'm aware of in core.

user_module_invoke('login', $array = array(), $user);

For readability it should be

$array = array();
user_module_invoke('login', $array, $user);
kylebrowning’s picture

Status: Needs work » Needs review
FileSize
1.11 KB

Set to needs review for patch testing and chose marcingy's way of doing things.

kylebrowning’s picture

Status: Needs review » Fixed
gateway69’s picture

the $array = array(), makes it work with PHP 5.3

Status: Fixed » Closed (fixed)

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