Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
During my migration while using the entity lookup plugin the content is automatically created and I am unable to stop it from building the content and making the reference. Example: We are importing a ton of user supplied data that might have references to unapproved content that I would like to fail upon attempting to import, rather than clean out of the site afterward
Proposed resolution
Allow for a flag to force an exception if the migration is not meant to create and reference the content.
Comments
Comment #2
mikeryanCould you share the .yml for the migration which is using the entity_lookup process plugin? There is no code within that plugin to create entities, so it's hard to see where the entities you're seeing are coming from (unless you're chaining with a migration process plugin, which will create stubs unless you set no_stub: true).
Comment #3
heddnThere's no code in lookup that will generate. Can you provide an example?
Comment #4
mikeryanComment #5
rob.barnett CreditAttribution: rob.barnett as a volunteer commentedI think this is related. I'm using entity_generate which extends EntityLookup. Entities are still getting created in my migration even though they already exist.
Here is the relevant code from my migrate_plus yml file
When I run drush mi with --update the entity will get created even though it already exists. Am I coding this incorrectly?
The query method in EntityLookup returns NULL because $results is empty on the query.
Comment #6
rob.barnett CreditAttribution: rob.barnett as a volunteer commentedComment #7
rob.barnett CreditAttribution: rob.barnett as a volunteer commentedComment #8
rob.barnett CreditAttribution: rob.barnett as a volunteer commentedI figured out my own problem. EntityLookup is working as intended for me. I had some logic being called in a transform method for a custom plugin that was interfering.