I get the following error after updating to 6.x-1.x-dev (2011-Aug-17). Last Version (Aug-10) worked for me.
warning: array_fill() [function.array-fill]: Number of elements must be positive in /usr/local/www/drupal6/sites/all/modules/ldap_integration/ldapdata.module on line 242.
warning: implode() [function.implode]: Invalid arguments passed in /usr/local/www/drupal6/sites/all/modules/ldap_integration/ldapdata.module on line 242.
My findings:
A function call changed from
221: $profile_fields = _ldapdata_retrieve_profile_fields();
to
239: $content_profile_fields = _ldapdata_retrieve_content_profile_fields();
Thats why the next command fails, since $profile_fields is not defined.
242: $placeholders = implode(',', array_fill(0, count($profile_fields), "'%s'"));
When i change the whole line 239 back to the previous version, everything works. As i dont use the content profile module, i cannot say how this works.
Comments
Comment #1
mweixel commentedI do use Content Profile, so I'm glad to see the beginnings of support for that module. The problem is that Content Profile stores the various parts of its related node part in a collection of CCK tables. ldapdata.module wants to use the traditional profile_fields tables as it tries to figure out what fields in the profile are dates.
It looks like the change to include Content Profile was started but not finished. Would it be possible to have _ldapdata_retrieve_content_profile_fields return the full array of arrays describing all of the Content Profile fields--including their type--and then just process any date fields in the profile based on that info? I can't think of any other way to do it, since there isn't a single table to query.
Comment #2
sutharsan commentedDuplicated by #1280458
Comment #3
sutharsan commentedIs error prevents the LDAP Data module from being used with the Profile module. The fix by superhenne enables the use of Profile module, but prevents the use of Content Profile module. :(
Comment #4
johnbarclay commentedA patch for this should include either a user interface for selecting profile vs. content profile or automatically use content profile if its installed. The patch to ldapdata.module should work with either.
Comment #5
johnbarclay commentedI also add this to the list at: http://drupal.org/node/1237378#comment-4833068
Comment #6
cgmonroe commentedFYI - The "correct" fix for this is not to replace the line with the old one as the top level entry describes. But to ADD this line back in. E.g.:
Old:
New:
This will enable both standard profile field support and (limited) content profile support. By limited, I mean it supports "R/O" operations where the content profile fields can be mapped to LDAP attributes... e.g. users can change Content Profile node fields, but next "sync" will reset them to LDAP values. Doesn't seem to support updating LDAP attributes when profile fields are changed.
Comment #7
cgmonroe commentedHere's a patch against the current head that adds in the missing line.
This will work with any combination of profile/content_profile modules. The functions called to populate the two *profile_fields variables already check if the appropriate module is enabled. In addition, the handler code below the patch already checks if the variables are set.
Comment #8
cgmonroe commentedMarking this as a duplicate of:
#1400154: Ldapdata module support for updating LDAP attributes from Content Profile Nodes
Which has a larger patch that fixes this and other problems related to content_profile support.
Comment #9
cgmonroe commentedSince this issue keeps the -dev version from working, the missing $profile_fields... line and some conditionals were committed.
Note that this is a small part of the the larger #1400154: Ldapdata module support for updating LDAP attributes from Content Profile Nodes code that still needs to be reviewed.