user_relationship_invites.module
When sending an invitation
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'rtid' cannot be null: INSERT INTO {user_relationship_invites} (inviter_uid, rtid, invite_code) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => 3Hk5ov6w ) in user_relationship_invites_invite() (line 64 of /home/test/public_html/modules/user_relationships/user_relationship_invites/user_relationship_invites.module).
to get rid of the errors I changes in user_relationship_invites.module line 49
from
$user->rtid = $form_state['values']['rtid'];
to
$user->rtid = $form_state['values'];
and line 61 commented out:
'rtid' => $args['inviter']->rtid,
the error clearly say that it expects a value but none is given. The rtid isnt used anyway until the invited user registers so thsi cleared a lot of errors for me.
Other errors caused by the Invite module reported there.

CommentFileSizeAuthor
#4 fix_invites2.patch7.39 KBberdir
#1 fix_invites.patch6.76 KBberdir

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new6.76 KB

The invites module hasn't been tested much yet.

- The error was because there are now proper permission checks done when getting the list of requestable relationships. Added a workaround to disable the permission check for the invited user and instead do the permission checking when adding the relationship.

- Also noticed that the part that displays that information in the registration form and actually created the relationship was still D6 code and could have never worked.

Please try the patch and also try that the relationship is properly created when the user registers.

Also, note that the Invite module is AFAIK quite far from being stable.

cutmedia’s picture

Hi Bedir,
I have both modules working to send invites and go through the registration, UR and Invite with the exception of the withdraw functionality in Invite. Yes Invite is way off D7 but with some patching and tweaking its not far off.
-Already see a typo in your patch:
$new_user->user_relotionships_allow_all = TRUE;
Should be:
$new_user->user_relationships_allow_all = TRUE;

will test the patch and report back, thanks.

cutmedia’s picture

If email is already registered the check gives an error:

Notice: Undefined property: stdClass::$mail in DatabaseStatementBase->fetchAllAssoc() (line 2069 of /home/memory/public_html/includes/database/database.inc).
The following recipient is already a member:
Anonymous (not verified) ()
You have already invited the following recipient:

The invitation mail is sent anyway, which shouldnt happen.
The PDO exception persists, as above, and the solution is the same as above, removing user_relationship_invites.module line 49

berdir’s picture

StatusFileSize
new7.39 KB

New patch that fixes the typo.

UR-Invites does not touch the mail address even remotely, so that has nothing to do with us but probably a bug in Invite.module itself.

Also, I'm not sure what code you are running, but the official current UR-Invite code has still the "core = 6.x" line in it, which means that you can't even install it without changing that manually or running it through coder. So it's not surprising that it doesn't work... ;)

cutmedia’s picture

Ok thanks, actually it installed no problem(?)
using Invite 7x dev code from here: http://drupal.org/node/1052170 with several of my own changes. There is not much movement on the Invite module but we need that functionality.
Basically all works, will look now at the verifaction and withdraw errors in invite.

and typo relationsihp:
Fatal error: Call to undefined function user_relationsihp_node_access_update_node() in /home/test/public_html/modules/user_relationships/user_relationship_node_access/user_relationship_node_access.module on line 211

berdir’s picture

Status: Needs review » Fixed

Ok, commited the patch, you're welcome to open a new issue if you experience more problems. Also fixed the fatal error.

Status: Fixed » Closed (fixed)

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