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).
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | legal-php-5.3-compat-951914-6.patch | 615 bytes | jgraham |
Comments
Comment #1
Anonymous (not verified) commentedCouldn't reproduce. Also tried with PHP 5.2
Best,
Paul Booker
Appcoast
Comment #2
fleetcommand commentedSorry 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:
With this one:
And all my warnings disappeared.
Comment #3
broncomania commented+1 and thx
Comment #4
sapox commentedYeap, this issue is still present.
#2 solve the problem for me.
This should be committed... soon.
Comment #5
bonobo commentedWe 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.
Comment #6
jgraham commentedAttaching 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'.
Comment #7
catchPatch looks good.
Comment #8
fizk commented#6 works for me.
Comment #9
milovan commented#6 works good. Please commit.
Comment #10
robert castelo commentedThanks for the patch, added to Legal 6.x-8.6