When trying to create a new user in Drupal, og field access gets called to limit field access. This causes custom fields not to show up on the user registration form.
In og_field_access_field_access
the following line is called:
if (!$id && $op == 'edit' && (og_is_group($entity_type, $entity) || og_is_group_content_type($entity_type, $bundle)))
og_is_group_content_type() evaluates to true for users, which causes the if sentence to be true when the user registration form is created.
In that if-body only users with groups can ever return true. But the user is 0, as the user is of cause not logged in, when trying to create a new user.
I would suggest a check for entity type user and then user id 0. If so skip the if sentence. Works for me in my own little patch.
Comment | File | Size | Author |
---|---|---|---|
#3 | access-denied-for-fields-user-registration-form-1529776-3.patch | 1016 bytes | RoySegall |
Comments
Comment #1
amitaibu> Works for me in my own little patch.
What patch? ;)
Does it happen in -dev version as-well?
Comment #2
checker CreditAttribution: checker commentedI can reproduce the same problem in current dev version.
Comment #3
RoySegall CreditAttribution: RoySegall commentedI think that his is what you mean by that.
Comment #5
amitaibu#3: access-denied-for-fields-user-registration-form-1529776-3.patch queued for re-testing.
Comment #7
checker CreditAttribution: checker commentedJust asking if this patch grant access to all user profile fields for a anonymous user?
Comment #8
amitaibu#3: access-denied-for-fields-user-registration-form-1529776-3.patch queued for re-testing.
Comment #10
Taxoman CreditAttribution: Taxoman commentedComment #11
amitaibu#3: access-denied-for-fields-user-registration-form-1529776-3.patch queued for re-testing.
Comment #12
amitaibuCommitted, thanks.
Comment #14
TechNikh CreditAttribution: TechNikh commentedmissing fields on user creation form for admin(who doesn't have administer groups permission) http://example.com/admin/people/create
Comment #14.0
TechNikh CreditAttribution: TechNikh commentedAdded "This causes custom fields not to show up on the user registration form."