I'm running the invite module on Drupal 4.7.1 with the userpoints module.

I'm seeing a couple of problems:

1) referring user is not being credited any points when a user they invite is enrolling ("Points for inviting a user" is set to 0; "Points when invited user registers" is set to 1.

2) Watchdog is logging the following errors when an invited user visits the site using their invitation URL
location: http://dev1.webwiseone.com/user/register/4b1f596a
message: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: node_load SELECT DISTINCT(n.nid), n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all'))) AND in /home/webwis2/public_html/dev1/includes/database.mysql.inc on line 120.

location: http://dev1.webwiseone.com/user/register/4b1f596a
message: implode(): Bad arguments. in /home/webwis2/public_html/dev1/modules/node.module on line 363.

location: http://dev1.webwiseone.com/user/register/4b1f596a
message: Invalid argument supplied for foreach() in /home/webwis2/public_html/dev1/modules/node.module on line 359.

If you need any more info, i'm happy to help.

Kevin

Comments

tomsun’s picture

I have almost the same issue. Using Drupal 4.7.3 without userpoints. These errors are displayed to the invited users when they have submitted their choice of username and password. Everything works fine as far as I can tell, but the errir messages are of course ugly to have. Haven't tried to trace what's causing them yet... Any suggestions?

Warning: Invalid argument supplied for foreach() in /home/foo/domains/bar/public_html/xyz/modules/node.module on line 359
Warning: implode(): Bad arguments. in /home/foo/domains/bar/public_html/xyz/modules/node.module on line 363
Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: node_load SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/foo/domains/bar/public_html/xyz/includes/database.mysql.inc on line 120

Warning: Cannot modify header information - headers already sent by (output started at /home/foo/domains/bar/public_html/xyz/modules/node.module:359) in /home/foo/domains/bar/public_html/xyz/includes/common.inc on line 266
torne’s picture

Title: Errors when invited user signs up. » Name conflict between og.module and invite.module causes errors

This is a namespace conflict between og and invite, see http://drupal.org/node/83184 for details.

Nick Wilson’s picture

I dont thinnk either of the reported issues look likea problem with the invite module. I'll leave the issue active for now in case anyone can add any more info,but I think the userpoints prob is a prob with userpoints most likely, and i've no idea about the 2nd one but invite doenst do anything with nodes so...

torne’s picture

The node_load errors come from og.module, but only happen because of invite.module. invite calls all _invite functions as a hook when someone accepts an invitation, but og happens to define a function og_invite that's totally unrelated. This gets called but passed arguments that it doesn't understand, which node_load blows up on.

Nick Wilson’s picture

Could you show me the specific piece of code, and perhaps suggest a fix or submit a patch?

thx

torne’s picture

It's anywhere that invite.module does module_invoke_all('invite', ...)

The only fix is to either change the name of the hook you call (which will break any modules that actually implement hook_invite, and 'invite' seems like a perfectly sensible name to use anyhow) or wait for Organic Groups to rename their og_invite function to something else.

Nick Wilson’s picture

Priority: Normal » Minor
Status: Active » Closed (fixed)

I think the latter sounds by far the more sensible option. If you would submit the bug report for OG it would be much appreciated!

Closing this one, thanks.

torne’s picture

Already done, as noted in my original comment.