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've mostly used Feeds Tamper when I'm building a few importers which hook entities up together with references of various sorts and I've always been puzzled by the lack of a generic "convert this GUID to an ID" plugin.
My concern with writing this plugin today, for example, was creating OG group nodes and then creating users and assigning them to the groups. Using this plugin (followed by the "explode" plugin to turn the single value into an array) and assigning the result to the "Group membership" field and it just works.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2007672-lookup-guid-plugin-4.patch | 1.8 KB | estrejlau |
#1 | 2007672-lookup-guid-plugin.patch | 1.8 KB | thsutton |
Comments
Comment #1
thsutton CreditAttribution: thsutton commentedPatch to add a "Lookup ID from GUID" plugin attached.
Comment #2
thsutton CreditAttribution: thsutton commentedComment #3
kenorb CreditAttribution: kenorb commented#2065307: GUID plugin for generating Unique Identifier based on selected source fields
Comment #3.0
kenorb CreditAttribution: kenorb commentedAdded description of motivation.
Comment #4
estrejlau CreditAttribution: estrejlau commentedThank you for this plugin/patch. I do want to point out that in the callback, there is no passed parameter or creation of $guid. The patch here uses the $field as the GUID by which to be searched. I hope this helps.
Comment #5
twistor CreditAttribution: twistor commentedAny Feeds target that can map to an entity should have an option to associate it by GUID.
If there isn't an option, please create a Feeds issue.
Also note, that this plugin exists.
#1647802: Plugin: Entity Field Query finder