I created some profile fields and restricted them for a particular role(say Role_A).The fields were mandatory fields.
Now when go to any user's profile (of role Role_A) and try to save it, validation also runs on the fields which are restricted. The user is not able to see those restricted fields though.
I have no clue what is happening. Can someone look into it?
Comments
Comment #1
murmel commentedI have the same problem as you have.
The fields are restricted, and can be entered only on registration.
Now the user can't update his profile, due to these fields being validated, even if they cannot be seen or changed by that role.
Comment #2
ilo commentedThe reason is the unset(), form api can't validate form fields that are no longer in the form array.
Closing because of duplicate with a patch to solve and other related issues at once: #957188: Fixing permissions, reset and validation errors on protected fields