Assign user roles based on the path the user is creating the account form doesn't work. Indeed, after a click on the save button. Changes are not saved and fields are empty.

I tried this patch to fix the issue but the problems persist.