Score:0

Migration lookup and no stubbing

jp flag

I have a problem with languages and no stubbing regarding migration_lookup plugin in Drupal 8. I have a different json data, each of them is different languages for example json with de:

data:{ id: 12345, name: 'Product 1 de', id: 123456, name: 'Product 2 de'}

json with en

data:{ id: 12345, name: 'Product 1 en'} 

of course this json is only example not validate.

I have a 2 migration yaml file called: migrate_plus.migration.data.yml and migrate_plus.migration.data_de.yml

English version is default version in drupal.

To join de version with en I use process:

nid:
    -
      plugin: migration_lookup
      source: id
      migration: data
      no_stub: true
      stub_id: data

I use no_stub: true because i don't want to create stub nodes for not existing en version. Everything works well but only for first time but if I want to update migration I got errors

[error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9424706c-e536-4a59-be13-ebb91367a1a9' for key 'node_field__uuid__value': INSERT INTO {node} (vid, type, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array

for de version item. In my case I don't want to create new stub item for english version for product 2 de so I though that no_stub option will be ok. Even if I do migrate:rollback I noticed that this migration from de still exist.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.