I'm calling JUserHelper::setUserGroups from within a plugin.
Users group membership changes and no other modifications are made to the user.
Every value stored in the #__fields_values table for that user are deleted.
J3.8.2 PHP7.1
I had a feeling this had something to do with the fields system plugin, so I took a quick peek and noticed that the fields aren't updated if there is an input variable "task" with a value of "activate", "block" or "unblock". So as a test, I set "task" = "unblock" and the field values remain. Fortunately, this doesn't actually unblock a blocked user, so I can work around this issue.
Without looking too closely, I believe this is a problem in the fields plugin, onContentAfterSave event. I believe that 2 lines of code would fix this.
Wrapping $model->setFieldValue($field->id, $item->id, $value);
with if(!is_null($value)) { }
would probably do it.
Labels |
Added:
?
|
Title |
|
Title |
|
Category | ⇒ | com_users |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-11-19 09:23:53 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/18699
I created PR #18701