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
Comment #1
berdirComment #2
berdirThe bug should be fixed in the 7.x-1.x-dev snapshot release, please confirm.
Comment #3
cjalden commentedI 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).
Comment #4
Liviu commentedIf 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.
Comment #6
CuanMarce commentedI 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).
Comment #7
deeray commentedI am facing the same issue as CuanMarce. How do I fix this? Thanks in advance
Comment #8
Nicolino77 commentedSame issue here! Please help!
Comment #9
adilsonmenezes commentedIn: 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!
Comment #10
queenvictoria commentedPatch for fix #9 attached. The constant changed in Invites module to INVITE_SESSION_CODE.
Comment #11
queenvictoria commentedComment #12
tesfayesolomon33 commentedThe bug is fixed in the 7.x-1.x-dev thank you @Berdir
Comment #13
heylookalive commentedSoo the
INVITE_SESSIONconstant is present in 2.x of Invite, according to the .info in theuser_relationship_invitessubmodule we're requiring 3.x at least which uses theconstant.This means that the patch in #10 is valid and committed, @queenvictoria thanks for the patch ma'am (man :)).