you might get rid of the $Configuration['Garden']['Registration']['InviteRoles'] = 'a:5:{i:3;s:1:"0";i:4;s:1:"0";i:8;s:1:"1";i:16;s:2:"-1";i:32;s:1:"1";}';
since you have the other ones
perhaps it isn't needed at all in 2.1 and it might confuse things.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
So the current theory is, that the field vanishes because the invitation was sent but does not regenerate for some reason. Maybe some timing thing. I don't really know.
The structure utility I used, it did some stuff. The update tells me it didn't work.
I've also searched the whole set of files of the forum software for "IncreaseInviteCount" which is in the UserModel and adds 1 or more invites to the user. The only instance where this method is called is when deleting a previously sent invite. These seems odd, as the monthly regeneration should be somewhere. Is this just me?
Well, the issue is that the count does not regenerate automatically, which is a bit of a bummer. I kind of want to get that fixed. Doing this manually every month is a bit of an unneccesary hassle...
Maybe I could write a simple plugin that does this?
// If CountInvitations is null (ie. never been set before) or it is a new month since the DateSetInvitations
if ($User->CountInvitations == '' || is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y')) {
// Reset CountInvitations and DateSetInvitations
$this->SQL->Put(
$this->Name,
array(
'CountInvitations' => $InviteCount,
'DateSetInvitations' => Gdn_Format::Date('', 'Y-m-01') // The first day of this month
),
array('UserID' => $UserID)
);
return $InviteCount;
But just by looking at that code I cannot find any issues...
Also, an interesting point: DateSetInvitations is "0000-00-00 00:00:00" in a bunch of users. Either that or null, where I presume that null is for those that did not invite anyone yet... Anyone have an idea why this could be the case?
Probably something's wrong with the line:
'DateSetInvitations' => Gdn_Format::Date('', 'Y-m-01') // The first day of this month
if ($User->CountInvitations == '' || $User->CountInvitations < $InviteCount || is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y')) {
However, when someone sends an invitation, their last-invitation time is still set to 0000-00-00 00:00:00. Which I feel is wrong. Unfortunately I can't seem to be able to find where this is set.
Edit: Also this doesn't work, obviously, because it always gives back invitaions, regardless of date. my bad.
However, when someone sends an invitation, their last-invitation time is still set to 0000-00-00 00:00:00. >Which I feel is wrong. Unfortunately I can't seem to be able to find where this is set.
beside your worry about their last-invitation time is still set to 0000-00-00 00:00:00 which you should file on github, the developers should know. That is what github is for.
did the change I suggest work for you to reset the invitations.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
if ( ( $User->CountInvitations == '' || $User->CountInvitations < $InviteCount ) && ( is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y') ) ) {
It still is weird, because DateSetInvitations remains "0000-00-00 00:00:00", regardless of what I do. I'm still looking at where this is set but I just can't find it. I am pretty sure this should be the date of the last sent invitation.
Also, even if I set the DateSetInvitations to a day a month ago it still doesn't update the invitations...
@peregrine: the change worked, but it would always reset the invitations, since as soon as they are below 1, they get reset. That's okay, but then I could just set them to unlimited.
Also this introduces the issue, that as soon as you have more invites than you should have, the system throws an error. And that's easily possible by inviting someone, then the system resets you, then you uninvite and suddenly you're over the max.
Comments
Alright, this seems to not have helped. I'll look into those utilities you mentioned
Awesome. there is really nothing to look into - it is a good idea to run them after uspgrades.
http://vanillaforums.org/discussion/comment/199096/#Comment_199096
you might get rid of the $Configuration['Garden']['Registration']['InviteRoles'] = 'a:5:{i:3;s:1:"0";i:4;s:1:"0";i:8;s:1:"1";i:16;s:2:"-1";i:32;s:1:"1";}';
since you have the other ones
perhaps it isn't needed at all in 2.1 and it might confuse things.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
The old invite roles are gone. All that is related to invite is:
$Configuration['Garden']['Registration']['InviteExpiration'] = '-2 weeks';
$Configuration['Garden']['Registration']['InviteRoles']['3'] = '0';
$Configuration['Garden']['Registration']['InviteRoles']['4'] = '0';
$Configuration['Garden']['Registration']['InviteRoles']['8'] = '1';
$Configuration['Garden']['Registration']['InviteRoles']['16'] = '-1';
$Configuration['Garden']['Registration']['InviteRoles']['32'] = '2';
So the current theory is, that the field vanishes because the invitation was sent but does not regenerate for some reason. Maybe some timing thing. I don't really know.
The structure utility I used, it did some stuff. The update tells me it didn't work.
The update tells me it didn't work.
try deleting the.ini files and run /utility/update again. it shouldn't fail
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Which ini files? the ones in "cache/"? I tried that but it didn't work either.
Also some reports from users do give additional weight to the idea that sent invites are not given back after the month is over.
I've also searched the whole set of files of the forum software for "IncreaseInviteCount" which is in the UserModel and adds 1 or more invites to the user. The only instance where this method is called is when deleting a previously sent invite. These seems odd, as the monthly regeneration should be somewhere. Is this just me?
Bumping this in the hopes that anayone here has an idea. So far no success...
what is your goal right now. do you want to fix count for some users.
you can adjust invite count for everyone via user table in the CountInvitations fields
if it says 5 the user has 5 left. if it say 0 the user has 0 left.
e.g. this will update the number of invitations to 2 for userid 6
UPDATE GDN_User
SET CountInvitations = '2' WHERE
GDN_User.
UserID` =6;this will reset everyones to 10
UPDATE GDN_User` SET CountInvitations = '10'
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Well, the issue is that the count does not regenerate automatically, which is a bit of a bummer. I kind of want to get that fixed. Doing this manually every month is a bit of an unneccesary hassle...
Maybe I could write a simple plugin that does this?
Better would be to find out what is happening and thus maybe fixing an issue with Vanilla. That seems to be the code where the reset happens:
But just by looking at that code I cannot find any issues...
Mabe something's wrong with DateSetInvitations?
set them all to DateSetInvitations and and lat least you will have a fighting chance.
and when do you expire things?
if you set expiration for a month it seems reasonable and they also regenrerate each month.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
they currently expire 2 weeks after being sent.
I'm not sure what you mean by "set them all to DateSetInvitations" though.
Also, an interesting point: DateSetInvitations is "0000-00-00 00:00:00" in a bunch of users. Either that or null, where I presume that null is for those that did not invite anyone yet... Anyone have an idea why this could be the case?
Probably something's wrong with the line:
'DateSetInvitations' => Gdn_Format::Date('', 'Y-m-01') // The first day of this month
it means those users already made invitations. when it says 0000-00-00 00:00:00
and they will not get more invites until you set the field to NULL or wait till the first of the month.
or set their Count to ""
yes you need to change things or wait till the first of the month.
UPDATE GDN_User SET DateSetInvitations = NULL
or try changing statement to
if ($User->CountInvitations < 1 ) || is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y')) {
or even
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
So, I've did the changes as follows:
However, when someone sends an invitation, their last-invitation time is still set to 0000-00-00 00:00:00. Which I feel is wrong. Unfortunately I can't seem to be able to find where this is set.
Edit: Also this doesn't work, obviously, because it always gives back invitaions, regardless of date. my bad.
beside your worry about their last-invitation time is still set to 0000-00-00 00:00:00 which you should file on github, the developers should know. That is what github is for.
did the change I suggest work for you to reset the invitations.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Changed it to:
if ( ( $User->CountInvitations == '' || $User->CountInvitations < $InviteCount ) && ( is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y') ) ) {
It still is weird, because DateSetInvitations remains "0000-00-00 00:00:00", regardless of what I do. I'm still looking at where this is set but I just can't find it. I am pretty sure this should be the date of the last sent invitation.
Also, even if I set the DateSetInvitations to a day a month ago it still doesn't update the invitations...
@peregrine: the change worked, but it would always reset the invitations, since as soon as they are below 1, they get reset. That's okay, but then I could just set them to unlimited.
Also this introduces the issue, that as soon as you have more invites than you should have, the system throws an error. And that's easily possible by inviting someone, then the system resets you, then you uninvite and suddenly you're over the max.
To explain:
I think there may be a bug also
I believe it needs the % anyway. but even with that it doesn't appear to write the date.
in the sql statement
Gdn_Format::Date('', '%Y-%m-01');
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.