entityreference_feeds.module string 311

// Fetch the entity ID resulting from the mapping table look-up.
            $entity_id = db_query(
              'SELECT entity_id FROM {feeds_item} WHERE guid = :guid',
              array(':guid' => $feeds_item->guid)
            )->fetchField();

In debug I see value $feeds_item->guid = 1
Result of this SQL query:
SELECT * FROM feeds_item WHERE (guid = '1');
entity_type | entity_id | id | feed_nid | imported | url | guid | hash
---------------------+-----------+---------------------+----------+-----------------+-----+------+----------------------------------
taxonomy_term | 161 | catalog_import | 0 | 1365676627 | | 1 | 8d13548e674432a18bbb3d93e9c2f807
node | 646 | color_import | 0 | 1366013567 | | 1 | 65c544adc950868062fbb750f3940876

After run this SQL query a have value 161 in $entity_id, but it must be 646

Right SQL query must be:
SELECT * FROM feeds_item WHERE (guid = '1') and (id='color_import')

Comments

gnucifer’s picture

Status: Active » Closed (works as designed)

A characteristic of the GUID is that it must be globally unique, you are breaking this with two different items having "1" as GUID. You have to make sure that all of your GUIDs are globally unique, also across different sources.