Hello,

I am trying to migrate my blog, and I am working on the book content type. I need to use the postImport method to fix the bid of the imported book (the root of the books).

I have implemented postImport in my destination class but it is not triggered and I can't find any call to the next functions in the migrate module.

public function preImport();
public function preRollback();
public function postImport();
public function postRollback();

Is it normal? Do I need to provide a patch?

Thanks for the responses.

Comments

mikeryan’s picture

Title: Some migrate destination interface function not triggered » Migrate pre/post Import/Rollback methods not invoked

You're right, they were added to the interface (or rather, copied from D7 migrate) but are currently unused in the D8 implementation. We need to think about how this functionality should be supported.

Separately, if the migrate_drupal book migration is not working for you out-of-the-box, can you report that at #2214259: Manual Testing: D6 Book? The last report there was that it was working (maintaining the books structure).

Thanks.

grimreaper’s picture

Ok, Thanks for your response. Should I wait before making a patch or could I try to do one now?

Ok, but it is a D7 migration https://github.com/FlorentTorregrosa/migrate_ftorregrosa, I used the D6 migrations as examples and I adjusted its.

If there are any elements in my module on github that would be useful to document or use, I will be very happy to contribute it. :)

mikeryan’s picture

Category: Bug report » Task
Status: Active » Postponed

At the moment, the plan is for this to be accomplished by #2535458: Dispatch events at key points during migration.

mikeryan’s picture

Status: Postponed » Closed (duplicate)

This functionality has been implemented using events - see https://www.drupal.org/node/2544874

grimreaper’s picture

Thank you very much.

couloir007’s picture

Using https://www.drupal.org/node/2544874 as my guide I've implemented a onPreImport. What I'm not able to do is test whether it is an --update or not. I need this conditional logic. Any thoughts?