Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Invitations no longer working. Get error: "Code is required."
I have successfuly used the Invitation registration option for few weeks. Today when im trying to send an invite i get an error: "Code is required."
I still have 5 invitaions left on my account but cant figure out why i get this error.
Tagged:
0
Comments
If you are the admin, you should have unlimited invitations…Look in the permission settings to see what might be wrong.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
upgrade to vanilla 2.2.1 and see if you have problems.
2.1 is an old version.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
I have same issue when inviting from regular member and from admin, thats what makes this so strage.
Do you have any idea what permission could cause this?
Anyone know what kind of code that may be required for the Invite feature?
Installation is 2.2.1, i cant find any setting in Dashboard to solve this error.
This is no permission issue. "Code is required." means, well that the field Code isn't filled although it is required. This is the code in class.invitationmodel.php:
$FormPostValues['Code'] = $this->GetInvitationCode();
I would assume that this function fails.
The function looks like that:
There is nothing critical in there. I wouldn't know how to solve this but using some debugging code to spit out variables throughout that code.
it looks like you posted in the 2.1 category, which is incorrect, that is why I suggested upgrading. But, Since you say you have 2.2.1
If you are not a great debugger, you might try disabling all other plugins and apps besides vanilla via dashboard and switch to default theme, then determine if you have an invitation code error with the least amount of complications from themes or add-ons.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
Thanks for all the suggestions and help.
Yes, you are so right. Just realized that i should have posted this in 2.2 Help. Maybe some Mod can help me move this discussion.
Im not a great debugger, so i have now tested disabling all plugins and running default theme and im still getting same Code error.
Any pointers to how i would go about to try debug this function?
Make a backup copy of
/applications/dashboard/models/class.invitationmodel.php
Start by finding the line
$FormPostValues['Code'] = $this->GetInvitationCode();
(line 102?)and add following lines below it:
Afterwards invite someone (invite someone that you have already invited. That way you wouldn't waste an invitation. Restore the original file (but keep the backup).
Look at
/uploads/log.tmp
: does it show a bunch of random characters? If yes, please report back!If no, find the following lines
Now add this below those lines:
Invite an already invited person, restore the original file.
Again, please report what there is in
/uploads/log.tmp
above debugging looks like a good idea.
Did you switch php versions?
also check your php error log for errors and post what modules you have installed and what os you have.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
I have now tested to debugg following your example.
Adding these lines will only result in empty log files.
Log files for first line:
debug1
''
Log file for second line:
debug2
Not sure why the log files are empty, maybe this could be the issue?
My host did not switch php version.
Not sure how to proceed?