I posted about this a couple of weeks ago and after quite a bit of troubleshooting I can confirm that the issue appears as follows:
Context
1) 'name' is set as
not required in the profile custom fields
2) 'name' is set to
not display during registration
3) 'name' is set as a
single name (not first, last)
Result
1) 'name' is not saved as 'username' in database, it is saved as 'Guest'
I think that the reason is that the following code snippet only checks for the 'name' if it is displayed during registration but not required:
public function onRegisterBeforeSave(&$post)
{
if (empty($post['first_name']) && !empty($post['username']) && $this->params->get('username_fallback')) {
$post['first_name'] = $post['username'];
}
return $this->save($post);
}
This piece of code should be modified to also check if the 'name' is not displayed
and not required during registration. Is there an easy fix? I could use the code on my site.
- JW