We have a drupal website using multiple roles. There are different required fields per role. All of the required fields work with the required by role module except for an image field. The image field allows users to upload unlimited images.
The settings are that the field should only be required by a specific role. We have checked Required Field and then below have checked only the role we need it required for. If we uncheck the Required Field and leave the checkbox for "The Field is needed for" then the system does not require the field. For all other fields we have Required Field checked along with the role under "The Field is needed for" and those work fine. (not required when creating a new user account with admin user)
1) When we try to create a user account using admin we get an error that the image field is required.
2) When we try to update the admin account we get the error that the image field is required.
3) If we uncheck Required Field then it doesn't prompt the users with the role we would like the field required for to upload an image.
Comments
Comment #2
lord_of_freaks commentedHi!!!
What's the role you are ticking to be required? if you choose "authenticated user" then all authenticated user will have to upload and image given all users share that role.
Best regards
Comment #3
webdevdoc commentedHi,
Thanks for the reply. I am only using on 1 role, not the general registered. https://www.screencast.com/t/yGkvVK3j
Comment #4
lord_of_freaks commentedWhich is not https://api.drupal.org/api/drupal/includes%21bootstrap.inc/constant/DRUP... and also the admin creating that user doesn't have it right?
Comment #5
webdevdoc commentedI am not sure what you mean with the link but I am using the default admin account and that account does have a role of authenticated but not the matrimonial role. Also, this issue happens when I log in as a user with a different role as well. So if I log in as a business user account with business user role and try to update my user info, I get the error that the profile image 2 field is required
EDIT - I do have a stage environment setup if you would like to take a look? FYI - I am happy to pay to have this resolved (as long as its not a ton of $)
Comment #6
lord_of_freaks commentedHi!!
I think I know what's going on. Probably the "authenticated user" role was renamed to "General registered users". Than role is common to every single user in Drupal which has an account, so if you select that role for something it would be shared across all your users with no exception.
Here there's a link to the documentation when you can find how roles and permissions work https://www.drupal.org/docs/7/managing-users/user-roles.
I personally recommend to specialise this kind of roles creating one and given one or few permissions, ... this works really well if you don't have too much use cases, so you can create a role called "mandatory profile picture" and then the module will work as you expect.
Unfortunately if the case is this one, there's nothing I can do given the behaviour is the expected one.
Best regards
Comment #7
webdevdoc commentedThanks for taking the time to think about it, unfortunately that image field is only required for that particular role, or at least that's what I am led to believe as the General Registered Users role is not selected, only the 1 role, but it shows up as required for all roles.
I do have Required field checked and Display on user registration form, however, the field only shows up on the 1 role, but is giving an error that it is required for all the other roles, even if it does not display on the edit screen.
I have hired someone to take a look, perhaps I am missing something, but I don't have the time or expertise to figure it out quickly.
Thanks anyway.
Cheers
Comment #8
avpadernoComment #9
dieterholvoet commentedThe Drupal 7 release of this module and Drupal 7 itself are unsupported. Feel free to reopen this issue if it is still relevant on the latest release of the module.