It's problem in both LDAP Feeds and LDAP User modules.
I've created a multivalue field field_member_groups with unlimited number of values and 4096 bytes field size.
LDAP User:
In section Provisioning from LDAP to Drupal Mapppings of LDAP User configuration I've set mapping from [memberOf] to Field: AD groups
After user logged in I see only one value from 11 values in LDAP.
LDAP Feeds:
In LDAP Query field Attributes to return is empty (that means All attributes).
Fetcher is LDAP Query Fetcher. Also i have a mapping in Mapping for User processor configuration which maps from memberof to AD groups. After import i have only one value in field_member_groups field.
I know about LDAP tokens [field:0], [field:1], [field:last]. I think that it is bad idea to make multivalue import by default for token [field], cause it can produce a lot of problems for default usage of this mapping (in LDAP we have default 1 value for field). May be it would be good if we will have a new option in LDAP tokens - [field:all] ?
I've no idea for LDAP Feeds but in real it is more importan for me. May be it would be new option:
Multiple values:
[*] All
[ ] First only
[ ] Last only
[ ] Nth: ______
About basic goals of this exorcism.
I need function which can import all permission information from LDAP (Active Directory) to Drupal field before user logged in. I need this information for Drupal's workflow application function to select a group of AD users. And this function must be independent of previous user activity on Drupal site. This requirement eliminates LDAP Authorization functionality.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | ldap_feeds-include_arrays-1911762-11.patch | 705 bytes | jkingsnorth |
Comments
Comment #1
johnbarclay commentedThis functionality would go in LDAP User module in the provisioning/synching aspect in the LDAP to Drupal direction. Like binary field support its a field mapping issue that can get quite complex as it does in the Feeds module. See also #1705984: Use LDAP Query and Feeds mapping with multi-valued attributes
Comment #2
trumanru commentedI think it needs work on dev-2.x version. Right?
Comment #3
johnbarclay commentedyes the 7.x-2.x-dev branch is the place for this work. If feeds, entity api, or feeds tamper are useful dependencies for any of this, I'd prefer to add them as dependencies than replicate their code. The general issue is supporting non standard fields, which include multivalue, binary, compound, etc.
Comment #4
michaelfavia commentedThe attached patch detects multi value fields and appends the values into an array. feeds importer handles the rest. this has been tested with multivalue text fields, taxonomy terms, etc
Comment #5
michaelfavia commentedPlease excuse the previous patch. it was headed the wrong direction
Comment #6
jkingsnorth commentedJust wondering why it would be a problem to just pass the whole array through, why do we need to rewrite it like your patch does?
ie: (where the 'else' says, 'if it IS an array...')
(Apologies for the lack of a real patch)
Comment #7
jkingsnorth commentedI submit, patch of the above attached. But there's probably a very good reason not to do it this way?
Comment #8
jkingsnorth commentedComment #9
johnbarclay commentedIf someone could test this patch, I'm happy to commit it.
Comment #10
peterpoe commentedWorks fine for me.
Comment #11
jkingsnorth commentedThe coding style on this patch was terribly, sorry. Please find a better one attached. I've set this back to needs review. Could someone confirm that it still works and there are no security (or other) implications?
Comment #12
Rmeja commentedThe patch works perfectly and matches our expectations
Comment #13
romainj commentedThanx works like a charm!
Comment #14
jkingsnorth commented3 reviews in total, marking as RTBC
Comment #15
lpalgarvio commentedreviving
Comment #16
bulldozer2003The patch in comment #11 works and should be committed.
Comment #17
cdmo commented#11 works, agree that this is RTBC. thanks.
Comment #19
queenvictoria commentedCommitted thanks!
Comment #20
lpalgarvio commentedPlease issue new beta release
Comment #21
kcolwell commentedThis patch just saved me so much time!
Thanks for the awesome code!