!first_name and !last_name are empty when provisionning is integrated with the content_profile module

yoho - April 23, 2009 - 13:28
Project:LDAP provisioning
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:miglius
Status:active
Issue tags:content_profile, integration
Description

In the "Basic LDAP attribute" section of the admin page, you should be able to use !first_name and !last_name keywords. But they are empty when you integrate with the profile module.

I've had a quick look at the code and the problems seems to come from ldapprov.module, on line 1082, you see a call to _ldapprov_create_user($values) but $values[profil_givenName] is empty (profil_givenName is the name of my profile field, it's not the default one). I don't know where it's supposed to be filled in, but none of the lines above seems to assign any value to $values[profil_givenName] (the foreach loop on line 1073 included : i've traced what is done in this loop, but profil_givenName is never read)

#1

miglius - May 5, 2009 - 21:19
Assigned to:Anonymous» miglius
Status:active» postponed (maintainer needs more info)

There was a typo in the code. I committed the fix which works for me. Please verify it.

#2

ChadAtKrell - May 7, 2009 - 21:12
Status:postponed (maintainer needs more info)» active

I'll add a report to this as well, with a request for any help that you can provide!

- I have the latest (from the 'v.6 tags' - which is the same as "HEAD" for ldap provisioning) versions of both content profile, ldap integration and ldap provisioning from CVS. (My working version of ldapprov.module is 1.53 )

I'm attempting to debug my way through to find where in the code the problem might be arising, but I'll add my description of the problem as well. I installed a clean version of Drupal (core) and the modules in question to make sure I'm looking at what I think I'm looking at...

1) I installed LDAP Provisioning, which works perfectly out of the box with the LDAP server.
2) I installed cck and content_profile, then created a content profile with two fields:

field_first_name ("Required")
field_last_name ("Required")

3) I add these fields to the

AttachmentSize
SafariScreenSnapz003.png 22.21 KB

#3

ChadAtKrell - May 7, 2009 - 21:47

UPDATE: I found where the issue here lies; perhaps with a change in the Content Profile (Registration) module?

At any rate, I noted in the ldapprov_register_submit function where the values are taken from the submitted registration form:

ORIGINAL:   $values = $form_state['values'];

... however, the actual data does not appear to be in that array. Looking at the data passed in to the register_submit function, I see that the data entered in the form appears here:

MODIFIED: $values = $form['user_registration_help']['#post'];

If I assign the variable '$values' to the second value, the registration process works. Now, there has to be a better way (I'm not an experienced Drupal developer, obviously) to access that data, but it appears that somewhere along the lines the submitted form data has been moved.

#4

miglius - May 8, 2009 - 21:53

Last time when I was integrating ldap_provisioning with the content profile, I have used version content_profile-6.x-1.0-beta3.tar.gz. So ldap_provisioning should work with a beta3 (could you verify that the bug you're describing does not occur with the beta3?).

Once a new release of content profile is out I will adjust ldap_provisioning to it.

#5

miglius - May 21, 2009 - 11:59
Title:!firstname and !lastname are empty when provisionning is integrated with profile module» !firstname and !lastname are empty when provisionning is integrated with a content_profile module

#6

roball - June 17, 2009 - 17:19
Title:!firstname and !lastname are empty when provisionning is integrated with a content_profile module» !first_name and !last_name are empty when provisionning is integrated with the content_profile module

#7

jgraham - October 30, 2009 - 03:22

Confirmed this bug exists with content_profile 6.x-1.0-beta4 and ldap_provisioning 6.x-1.0-beta1

Attached is a patch against 6.x-1.0beta1, which implements what ChadAtKrell suggests above. In addition it adjusts another section of code since the content_profile fields no longer come through the values array they need to be accessed at "FIELDNAME[0]['value']". There may be more sections that need similar adjustment.

Apply with 'patch -p0 < 442788.patch' from where your ldap_provisioning module is located.

AttachmentSize
442788.patch 1.01 KB
 
 

Drupal is a registered trademark of Dries Buytaert.