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.

CommentFileSizeAuthor
#2 patch.txt1.62 KBveracium

Comments

veracium’s picture

Title: user_relationship_invites and Invoke API » user_relationship_invites and Invite API
veracium’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new1.62 KB

This 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.

YK85’s picture

Status: Patch (to be ported) » Needs review

i don't know how to test this but setting the correct status

alex.k’s picture

Status: Needs review » Needs work

@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.

veracium’s picture

@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.

alex.k’s picture

Sure, 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.

alex.k’s picture

Status: Needs work » Fixed

Committed fix for hook_invite in http://drupal.org/cvs?commit=370712. Please try that and let me know if you still get warnings.

Status: Fixed » Closed (fixed)

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