How to hide roles from user_profil_form while keeping value? After loading user_profil_form form, I tried to hide the roles fields.
It worked fine, however after submitting the form, my user roles are removed and it's only linked to "authenticated user".

Is there a way hide this field but keeping the value ? I would not like to user the alter hook in order to keep the full form in the admin pages.

Thank you
In my experience, unsetting the field works fine to disallow access to a field while keeping values on update. For example:

/**
 * Implements hook_form_alter.
 */
function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  if ($form_id == 'user_profile_form') {
    unset($form['account']['roles']);
  }
}