-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First and Last Name fields can't be populated by cas_attributes module #396
Comments
@varuntit101 For social auth logins, you can use this https://github.com/kscheirer/Social-Auth-Map-Name to enable first name and last name field mapping. I wrote up some sparse instructions here: apigee/apigee-devportal-kickstart-drupal#238 (comment). |
@jemisonf The problem is likely here in the cas_attributes module: https://git.drupalcode.org/project/cas_attributes/-/blob/8.x-1.x/src/Form/CasAttributesSettings.php#L131, though I havent tested that out. The fields that will be rendered must have a target bundle defined, and be of type 'string' or 'list_string', so I'm guessing one of those conditions is not true. |
@kscheirer I tried using https://github.com/kscheirer/Social-Auth-Map-Name, this works absolutely fine with Social Auth Google, but It is failing with Social Auth GitHub, it is giving error on following code :- $user->set('first_name', $userInfo->getFirstName()); |
@kscheirer thanks, that's a good find! It looks like the Either way, that gives me a way I can temporarily fix it right now to resolve the issue, which is great. |
Follow-on to that: it looks like the issue isn't actually that if (!empty($definition->getTargetBundle())) { Which is failing because |
@jemisonf I added a PR that would add the bundle to the first/last name fields. Not sure if any other module is needing this, but I don't see harm in adding it either. |
@arlina-espinoza that looks great, thank you! I'll keep an eye out for it in future releases. |
Describe the bug
I'd like to be able to populate the "First Name" and "Last Name" fields for a user using CAS attribute tokens provided by the cas_attributes module. This is possible for "normal" fields like username/email, and "normal" custom fields -- I tested this out by adding a "Nickname" field that I was able to configure.
I think this is an issue related to how those fields are added to the user entity, but I have no idea how to approach this problem otherwise.
If this is the wrong repository for this issue, let me know and I can move it somewhere else.
To Reproduce
Steps to reproduce the behavior:
cas_attributes
moduleExpected behavior
I would expect the "Fields" section in step four to also show "First Name" and "Last Name".
Screenshots
Here's what the user fields mapping section looks like:
Additional context
This also causes an issue where users whose accounts are created via a CAS sign-in don't have a first name and last name configured by default, which can then cause issues on subsequent sign-ins. Previously, in our D7 portal, we were able to use cas_attributes to automatically populate these values, which made the process transparent to users.
Version Info
1.8.0
The text was updated successfully, but these errors were encountered: