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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Steven Jones’s picture

Status: Active » Needs work
FileSize
1.66 KB

So 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.

moshe weitzman’s picture

I 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.

mikeryan’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, migrate-1944060-drush-content-return.patch, failed testing.

pifagor’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)