gotski
Active member
Hello, I created extend, I want to add my new members to secondary user group after registration, but I'll received error: "LogicException: Attempted to set 'secondary_group_ids' while a save was pending without forceSet in src\XF\Mvc\Entity\Entity.php at line 529"
are there any ideas, how can I solve my task?
Thanks!
are there any ideas, how can I solve my task?
Thanks!
Code:
class User extends XFCP_User {
protected function _postSave()
{
parent::_postSave();
if ($this->isInsert())
{
$userGroupChange = $this->app()->service('XF:User\UserGroupChange');
$userGroupChange->addUserGroupChange($this->user_id, '', '5');
}
}
}