I just noticed a bug in the UR-Invites, an undefined variable happens when user try to register normally without using invite code.

Notice: Undefined variable: _SESSION in user_relationship_invites_form_user_register_form_alter() (line 76 of /.../sites/all/modules/contrib/user_relationships/user_relationship_invites/user_relationship_invites.module).

Adding isset() function to _SESSION seems to fix the bug. Line 76

$invite_session = isset($_SESSION[INVITE_SESSION]) ? $_SESSION[INVITE_SESSION]: 0;
if (($code = $invite_session) && ($invite = user_relationship_invites_get_invite($code)) && $invite->relationship_type) {

If anyone else got better fix, let me know.

Comments

berdir’s picture

Status: Active » Fixed
berdir’s picture

Version: 7.x-1.0-alpha3 » 7.x-1.x-dev

The bug should be fixed in the 7.x-1.x-dev snapshot release, please confirm.

cjalden’s picture

I experienced the same error and updating to 7.x-1.x-dev from 7.x-1.0-alpha3 seems to have fixed it (ie not seeing the same error, though haven't thoroughly tested it).

Liviu’s picture

If you don't want to change from alpha to dev you can replace line 76:
if (($code = $_SESSION[INVITE_SESSION]) && ($invite = user_relationship_invites_get_invite($code)) && $invite->relationship_type)
with this one:
if (!empty($_SESSION[INVITE_SESSION]) && ($code = $_SESSION[INVITE_SESSION]) && ($invite = user_relationship_invites_get_invite($code)) && $invite->relationship_type)
In this way I managed to resolve and to not show the error.

Status: Fixed » Closed (fixed)

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

CuanMarce’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha5

I get this in line 106

Notice: Use of undefined constant INVITE_SESSION - assumed 'INVITE_SESSION' in user_relationship_invites_form_user_register_form_alter() (líne 106 of //sites/all/modules/user_relationships/user_relationship_invites/user_relationship_invites.module).

deeray’s picture

I am facing the same issue as CuanMarce. How do I fix this? Thanks in advance

Nicolino77’s picture

Same issue here! Please help!

adilsonmenezes’s picture

In: sites\all\modules\user_relationships\user_relationship_invites\user_relationship_invites.module

Replace :
if (!empty($_SESSION[INVITE_SESSION]) && ($code = $_SESSION[INVITE_SESSION]) && ($invite = user_relationship_invites_get_invite($code)) && $invite->relationship_type) {

by:
if (!empty($_SESSION[INVITE_SESSION_CODE]) && ($code = $_SESSION[INVITE_SESSION_CODE]) && ($invite = user_relationship_invites_get_invite($code)) && $invite->relationship_type) {

Good luck, have fun!

queenvictoria’s picture

Issue summary: View changes
StatusFileSize
new938 bytes

Patch for fix #9 attached. The constant changed in Invites module to INVITE_SESSION_CODE.

queenvictoria’s picture

Version: 7.x-1.0-alpha5 » 7.x-1.x-dev
Status: Closed (fixed) » Needs review
tesfayesolomon33’s picture

The bug is fixed in the 7.x-1.x-dev thank you @Berdir

heylookalive’s picture

Status: Needs review » Fixed

Soo the INVITE_SESSION constant is present in 2.x of Invite, according to the .info in the user_relationship_invites submodule we're requiring 3.x at least which uses the constant.

This means that the patch in #10 is valid and committed, @queenvictoria thanks for the patch ma'am (man :)).

Status: Fixed » Closed (fixed)

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