Hello,
I apologize in advance if this question is difficult to debug because I did not write the code and it would be too long to post the entire source code (it's based on elgg, an open source community builder).
However maybe you guys could help me with your experience and insights...that is to say, I would be grateful if you could even just throw debugging ideas without actually spotting errors in this code.
Here is the code that works (i.e. displays the : "invitations/invitationsregisterform" page)
// If we're not logged in, display the registration page
if (!isloggedin()) {
// If invitation is not valid, redirect to start page
if ($invitation) {
if (code_error($invitation, $code)) {
register_error(code_error($invitation, $code));
// echo page_draw(elgg_echo('CODE ERROR'), elgg_view("invitations/invitationsregisterform"));
forward();
} else if (invitation_expired($invitation->time_created, $expiration_days)) {
register_error(invitation_expired($invitation->time_created, $expiration_days));
// echo page_draw(elgg_echo('EXPIRED'), elgg_view("invitations/invitationsregisterform"));
forward();
} else if (invitatio_used($invitation)) {
register_error(invitatio_used($invitation));
// echo page_draw(elgg_echo('USED'), elgg_view("invitations/invitationsregisterform"));
forward();
} else {
var_dump($invitation);
echo page_draw(elgg_echo('register'), elgg_view("invitations/invitationsregisterform"));
}
}
// Otherwise, forward to the index page
} else {
forward();
}
However, the exact same code does not work if this piece
else {
var_dump($invitation);
echo page_draw(elgg_echo('register'), elgg_view("invitations/invitationsregisterform"));
}
is changed to simply
else {
echo page_draw(elgg_echo('register'), elgg_view("invitations/invitationsregisterform"));
}
where I stripped off
var_dump($invitation);
EDIT: by does not work I mean that the page redirects me to home, which I guess happens by default or some other reason I don't know