Gossamer
Active member
I have a datawriter that isn't saving, and I can't figure out why.
Extended User Datawriter
Obviously the second half is unfinished. But I've confirmed that the code is running through the portion where it's supposed to be setting and saving the secondary group. It has the id of the correct secondaryGroup, but it's just not saving.
Extended User Datawriter
PHP:
public function updateActivityStatus($userId)
{
$userModel = $this->_getUserModel();
$posts = $userModel->getActivityPosts($userId);
$options = XenForo_Application::get('options');
/* check the activity posts and update usergroup appropriately */
if(count($posts) < 3)
{
/* move to low activity group OR deletion group */
/* set secondary usergroup based on current usergroups */
$lowActivityUserGroup = $options->rps_ActivityCheck_LowActivity_Usergroup;
$deletionUserGroup = $options->rps_ActivityCheck_Deletion_Usergroup;
$secondaryUsergroups = explode(',', $this->get('secondary_group_ids'));
$userModel = $this->_getUserModel();
if($lowActivityUserGroup != null && $deletionUserGroup != null)
{
/* user is not in low activity group */
if(!$userModel->isLowActivity($userId))
{
/* add user to low activity group */
$secondaryUsergroups[] = $lowActivityUserGroup;
$this->setExistingData($userId);
$this->setSecondaryGroups($secondaryUsergroups);
$this->save();
}
/* IF user is in low activity group AND enough time has passed Add user to deletion usergroup */
}
}
else
{
/* remove from low activity or deletion group */
}
Obviously the second half is unfinished. But I've confirmed that the code is running through the portion where it's supposed to be setting and saving the secondary group. It has the id of the correct secondaryGroup, but it's just not saving.