Click Copy key from reset-password e-Mail and confirm your new password. Check your
custom fields, they're reset.
Custom fields stay the same
Custom fields get reset,actually removed from DB
Joomla 3.8 (has been updated from 3.7). It can be that it
did not work before the update to 3.8 too. But not sure
Without testing, I think the issue could be sorted by changing this line of code https://github.com/joomla/joomla-cms/blob/staging/plugins/system/fields/fields.php#L124 to
if (in_array($task, array('activate', 'block', 'unblock', 'complete')))
However, look like we are doing it in wrong way. What if someone calls $user->save method from custom code (like in third party extensions), the $task variable can have different value and from quick read at the code, look like the custom field data is lost, too
@joomdonation that snippet also didn't fix it yet. But the error can definetly be in that file. The strange thing is that a fresh joomla installation works well but the updated one doesn't.
Looking at the code a bit more, I think change the code to the code below should fix it:
if (in_array($task, array('activate', 'block', 'unblock', 'request', 'complete')))
I think we should also check $option variable and make sure the fields data is only saved if the code is run in com_users only
So the whole code of that method could be changed to:
public function onUserAfterSave($userData, $isNew, $success, $msg)
{
// It is not possible to manipulate the user during save events
// Check if data is valid or we are in a recursion
if (!$userData['id'] || !$success)
{
return true;
}
$user = JFactory::getUser($userData['id']);
$task = JFactory::getApplication()->input->getCmd('task');
$option = JFactory::getApplication()->input->getCmd('option');
// Skip fields save when we activate a user, because we will lose the saved data
if ($option != 'com_users' || in_array($task, array('request', 'activate', 'block', 'unblock', 'complete')))
{
return true;
}
// Trigger the events with a real user
$this->onContentAfterSave('com_users.user', $user, false, $userData);
return true;
}
That would prevent custom fields are from being reset when $user->save method being called from outside com_users (like in third party extensions)
Closed_Date | 2017-10-02 13:21:47 | ⇒ | 2017-10-02 13:21:48 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-10-02 13:21:47 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/18185
closed as having Pull Request #18188
Hi, sorry for commenting this old issue, but looking at history I cannot understand if this bug has been fixed, and in what Joomla version... I followed some linked issues and ended here:
#18207
All issues seems to be closed without assigned milestone.
Check anyone check this?
Thank you
i have the same problem at the registration in "new fields"
from joomla 3.7 to 3.8
With the new fields - the required fields are deleted when the password has been reset.
Members of the site forgot their password - make a password reset - then are the fields empty