Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When importing a field collection where the Identifier Field is a Entity Reference Field, you the following warning:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_name0.field_name_value' in 'where clause'
where field_data_field_name is the table from the field and field_name_value the expented field where the field value resides.
But when the field is a Entity Reference, the field value resides in field_name_target_id.
Comment | File | Size | Author |
---|---|---|---|
#4 | field_collection_feeds-sql_error_on_entity_reference-2572363-4.patch | 1.55 KB | tucho |
Comments
Comment #2
tuchoI attach a patch for this issue.
Now the field type is checked on the entitySave method the field type, and the EntityFieldQuery points to the right field.
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThis seems to work for me.
Comment #4
tuchoThere was an error on the first patch. It throws a warning when the entity does not exists.
I attach a new one, with this problem fixed.
Comment #5
wak CreditAttribution: wak commentedThanks for the patch so far!
Would it be possible to include Taxonomy Terms, too? They need 'tid' instead of 'target-id' or 'value' and do not work with the patch therefore.
There might be even more cases not handled yet, like files oder users.