I know it is possible to hide most fields defined on
/admin/config/people/accounts/fields on the user edit form
/user/<uid>/edit by using the HOOK_form_alter function in a custom module like this targeting
$form['field_account_myfield']['#access'] = 0;
But how to hide user profile form fields the right way (no CSS tricks)?
in my case the URL is
/user/<uid>/edit/Profil. These are the fields you can define with the core profile module enabled on
They are defined as object properties in the
$form['#user'] object, e.g.:
['#access'] = 0 does not seem to work.