Whenever I invite someone, I get the following warning:
warning: Parameter 2 to user_relationship_invites_invite() expected to be a reference, value given in /var/www/includes/module.inc on line 483.
I think I have nailed the problem. This is the offending function:
function user_relationship_invites_invite($op, &$args)
But according to the Invite API, hook_invite() should be of the form:
function hook_invite($op, $args) {
I also found that when the invitee accept the invite, the relationship is not automatically created. I am not sure if this is the cause.
Comments
Comment #1
veracium commentedComment #2
veracium commentedThis is not a problem with the module, but with PHP5.3 incompatibility discussed here:
http://drupal.org/node/360605
I created a small patch to fix make the module PHP5.3 compatible.
Comment #3
YK85 commentedi don't know how to test this but setting the correct status
Comment #4
alex.k commented@veracium thank you for troubleshooting. I checked invite module docs and indeed it's supposed to be passed by value.
I noticed you changed the other functions as well, which are actually supposed to be passing by reference. Both hook_user and hook_form_alter, as well as other implementation of form_validate that I see. Please chime in but I think they are not causing any 5.3 related warnings.
Comment #5
veracium commented@alex.k, thanks for your wonderful module.
I tested the patched code on our website and it worked fine under both PHP 5.3.2-1 and PHP 5.2.13, and it worked as expected.
Comment #6
alex.k commentedSure, it may work but we have to implement the hooks as given. If passing by reference to hook_user and hook_form_alter causes you warnings on PHP 5.3, then we have a bug somewhere. But passing the arguments by value where the spec says to pass by reference will break our impl of those hooks.
Comment #7
alex.k commentedCommitted fix for hook_invite in http://drupal.org/cvs?commit=370712. Please try that and let me know if you still get warnings.