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.
At the moment, if you're implement a drush post command hook for migrate-import it's really hard to know if the import command actually completed successfully or not. It's quite easy to just pop the return values from the migrations into a context for later use.
Comment | File | Size | Author |
---|---|---|---|
#1 | migrate-1944060-drush-content-return.patch | 1.66 KB | Steven Jones |
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedSo here's a patch based on 67d099fad8738f1080413e4a282012cacd2740d7 which happens to be the version of migrate that I'm running from, sorry,
It just sets the return values of the migrate into a Drush context, and works nicely.
Marking as 'needs work' as this needs re-rolling for migrate 7.x-2.x.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedI think that drush_migrate_import (and other command callbacks) should just return their data, in addition to printing it. That makes data available to post hooks. Those might have to call drush_backend_get_result(). This has changed over Drush's history so your version may differ.
Comment #3
mikeryanComment #5
pifagor