Groups change, field values remain
groups change, field values are defaulted
J3.7.5
I created a CLI to test this and it works as expected. This only seems to happen if I add or remove groups within a user onUserAfterSave event
My temporary solution is to not use JUserHelper to add or remove groups, instead I'm querying the table directly to make my changes. I would rather not do this, but it keeps me moving forward:
$db->setQuery('DELETE FROM #__user_usergroup_map WHERE user_id = '.$id.' AND group_id IN ('.implode(',',$removegroups).')');
$db->execute();
if(!in_array($addid,$user->groups)) {
$o = new stdClass();
$o->user_id = $id;
$o->group_id = $addid;
$db->insertObject('#__user_usergroup_map',$o);
}
Labels |
Added:
?
|
Category | ⇒ | com_fields |
Status | Duplicate Report | ⇒ | Closed |
Closed_Date | 2017-09-20 18:22:14 | ⇒ | 2017-09-20 18:22:15 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Status | New | ⇒ | Duplicate Report |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-20 18:22:14 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/17878
closed as duplicate Report. Thanks for Hint @Denitz
Duplicate, see #17801 and #17837