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.
I ran across this issue when converting an array of text values into a list of nids for an entity reference field by searching on a field value corresponding to each text value with Entity Field Query Finder. I found that if the Entity Field Query Finder plugin gets not results from the query, all element items are removed from the $result. I believe that instead of removing all items from the result, only the current item should be removed.
The following code change inside of the feeds_tamper_efq_finder_callback function works, but may not be the ideal solution:
else {
// We didn't find a value, remove the item.
// @todo Fallback.
- unset($result->items[$item_key][$element_key]);
+ $delta = array_search($field, $result->items[$item_key][$element_key]);
+ unset($result->items[$item_key][$element_key][$delta]);
}
Comment | File | Size | Author |
---|---|---|---|
#3 | feeds_tamper-2792585-3.patch | 828 bytes | twistor |
|
Comments
Comment #2
slbrassard CreditAttribution: slbrassard commentedAfter having done more testing, I have come up with the following code:
Comment #3
twistor CreditAttribution: twistor as a volunteer commentedHere's a patch, with some things changed around a bit.
Comment #5
twistor CreditAttribution: twistor as a volunteer commented