0

I'm trying to import data from custom source through Migrate in Drupal 8. The problem is that I need to process data which have references to each other. This is excerpt from my migration articles:

field_recommended_articles:
    -
      plugin: string_in_array
      key: id
      source: recommended_articles
    -
      plugin: migration_lookup
      migration: articles
      source: id

This seems to lead to recursion, because following error appears with stack trace containing repeating calls to respective migrate-related methods.

PHP Fatal error:  Maximum function nesting level of '2000' reached, aborting! in .../core/lib/Drupal/Core/Database/Statement.php on line 153

How can I solve this?

The recursion was caused by xdebug. Without it, there is a reference value created, but each value references the same content.

  • This cannot work by concept. You are looking for a key, that will be created after the current row was saved, Try splitting it into two separate migrations: the first one creates the articles, the second one updates the recommended articles field. – Hudri Feb 5 '18 at 9:29
  • @Hudri, thanks for a hint. I thought, that this is how stubs should work. Now I don't get that error, since I disabled xdebug. But it still doesn't work. – Miloš Kroulík Feb 5 '18 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.