I made empty taxonomy vocabulary named "Departments".
In user profile i've created a new field named "Work department":
Label: Work department
Machine name: field_work_department
Field type: Term reference (related to "Departments" vocabulary).
Widget: Autocomplete term widget (tagging)
It works when I fill it from UI.
But if I try to import data via feeds importer which worked fine before I've added this new field it stops with the message:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=756&op=do StatusText: error ResponseText:
If I open page /import/ldap_data_to_user_fields/log I could see this message:
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'top management' for column 'field_work_department_tid' at row 1
Original item
array (
'dn' => 'CN=John Doe,OU=ALL,OU=Users,OU=BELL,DC=domain,DC=company,DC=ru',
'mail' => 'JDoe@company.ru',
'samaccountname' => 'JDoe',
'title' => 'Chief Executive Officer',
'mobile' => '+7 (123) 456-7890',
'department' => 'top management',
)
Entity
/* <some data cuted> */
'field_work_department' =>
array (
'und' =>
array (
0 =>
array (
'tid' => 'top management',
),
),
),
/* <some data cuted> */As I see this code trying to write text value into integer key field "tid".
Additionally all taxonomy terms for "Departments" vocabulary during this import were created correctly.
Comments
Comment #1
trumanru commentedComment #2
johnbarclay commentedThanks for the detailed diagnosis.
Patch would be very welcome on this. The LDAP Feeds module hasn't gotten a lot of love lately and has no simpletest coverage; largely because of the indeterminate state of feeds roadmap and betas. #301678: More flexible verse formatting
Any work on ldap feeds to make it more functional will take the edge cases out of ldap user provisioning to Drupal and help keep the complexity of the code base and ui down.
Comment #3
trumanru commentedLDAP User module have same error. If I configure mapping for LDAP field [department] into the "Field: Work department" wich is taxonomy term I couldn't log in any LDAP User cause i've got the error:
I'm beginner in Drupal and PHP and I'm not ready to complete this job. I could help any expert who will solve this problem. And I could try to do it later if my current project which is depended on LDAP module will be OK.
Comment #3.0
trumanru commentedCorrecting mistake in error report.
Comment #4
johnbarclay commentedThe logic is in ldap_user/LdapUserConf::entryToUserEdit() and only accounts for fields which have a very simple form (see code below)
The bug fix for this would be to look at the $field returned from $field = field_info_field($value_name) and see if it is of this simple form. If its not, don't attempt to add it to the $edit array. And fix the documentation to this effect in the UI.
After this additional fixes/exceptions can be added to accommodate different fields such as taxonomy terms. At some point it will make sense to make feeds an optional module and leverage its plugins for some of these mappings. Things like vocabularies get tricky because of hierarchy and mapping of term vs term id.
Comment #5
johnbarclay commentedComment #5.0
johnbarclay commentedRemoved mistakes
Comment #6
samwilson commentedAny news on this? Seems to still be happening in
7.x-2.0-beta8when trying to sync data into a Entity Reference field.Comment #7
grahlDoes no one have a patch or temporary workaround for this to start from?
Comment #8
grahlNo patch and Feeds support ends with 7.x-2.x, thus closing.