Using PHP 5.3, when a user needs to re-accept the changed Terms and Conditions, a lot of PHP errors are generated in the database log like this:
Parameter 3 to system_user() expected to be a reference, value given - /home/alapitvany/www/public/includes/module.inc - 483. sor.

The line 483 of module.inc seems to be in the module_invoke_all function which causes some problems with PHP 5.3. Function module_invoke_all is called from legal.module:274 the following way:

      // Destroy the current session.
      session_destroy();
      module_invoke_all('user', 'logout', NULL, $user);

I googled a little bit and it seems that module_invoke_all caused troubles for others too (see #679404: Warning: Parameter 1 to profile_load_profile() expected to be a reference, value given in module_invoke() for a detailed thread on it).

CommentFileSizeAuthor
#6 legal-php-5.3-compat-951914-6.patch615 bytesjgraham

Comments

Anonymous’s picture

Status: Active » Closed (duplicate)

Couldn't reproduce. Also tried with PHP 5.2

Best,
Paul Booker
Appcoast

fleetcommand’s picture

Version: 6.x-2.3-rc1 » 6.x-2.4-rc2
Status: Closed (duplicate) » Needs review

Sorry to reopen this issue, but I found a possible solution. In D6, the user_logout function uses user_module_invoke instead of module_invoke_all.

Then I replaced this line in legal.module:

module_invoke_all('user', 'logout', NULL, $user);

With this one:

 $null = NULL;
 user_module_invoke('logout', $null, $user);

And all my warnings disappeared.

broncomania’s picture

+1 and thx

sapox’s picture

Version: 6.x-2.4-rc2 » 6.x-8.5
Status: Needs review » Reviewed & tested by the community

Yeap, this issue is still present.
#2 solve the problem for me.

This should be committed... soon.

bonobo’s picture

Status: Reviewed & tested by the community » Active

We are seeing this on 6.x-8.5 as well.

To reproduce -

On a test site with an existing userbase:

1. Enable legal module, and set terms and conditions.
2. Create a new user.
3. Log in with the new user; you will see a series of errors upon initial login.
4. Accept terms and conditions; the errors will go away.

I'm unsetting the solution here from "reviewed and tested" - we'll look into this in more detail and report back what we find.

jgraham’s picture

Status: Active » Needs review
StatusFileSize
new615 bytes

Attaching a patch to apply the changes suggested by fleetcommand in comment 2.

This resolves numerous errors similar to 'Parameter X to MODULE_user() expected to be a reference, value given'.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good.

fizk’s picture

#6 works for me.

milovan’s picture

#6 works good. Please commit.

robert castelo’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Thanks for the patch, added to Legal 6.x-8.6

Status: Fixed » Closed (fixed)

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