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 was pulling my hair out attempting to get the --idlist flag to work with the URL migrate source plugin.
Tried to access the list of ids passed by the command line throughout all the migration classes and wasn't able to.
Currently working with a JSON migration that is pulled from an outside url.
Found this (attached patch) to be the best way to access the idlist from within the migration source / data parser plugins.
Comment | File | Size | Author |
---|---|---|---|
#5 | idlist-passed-to-migration-2859859-5.patch | 553 bytes | Ericmaster |
Comments
Comment #2
swiftsystems CreditAttribution: swiftsystems as a volunteer commentedComment #3
mikeryanI haven't seen a problem with --idlist with XML/JSON migrations before - can you describe a little more what the issue is?
I'm not sure how adding "idlist" on the migration class helps, when there's nothing that reads it.
Comment #4
heddnI think this is fixed by #2798363: Implement --idlist options on rollback and messages
Comment #5
Ericmaster CreditAttribution: Ericmaster as a volunteer commentedI'm sorry for hijacking this closed ticket, but still needed this to optimize a custom source plugin and couldn't figure out a way to access the idlist so I can bypass some custom row processing when the id is not in the list, in case anyone is interested I re-rolled the patch for 8.x-5.x as a temporary solution. Thinking in the long term, maybe a way could be added (if there isn't one already that I haven't found yet) to access the MigrateExecutable object from the source plugin implementation?