1

I am trying to migrate some data with the migrate api in a custom entity called Seller.

Each seller has an email address with a constraint "UniqueField" which checks, that the email address is just entered once. If i try to import a seller with an existing email address, the seller will be created although the email already exists.

So my question is: Doesn't the migration api consider the entity validation or how can I do this?

One solution for the problem would be to write a custom process plugin for the email address, but it would be nice, if the entity validation would check this automatically.

1 Answer 1

0

There is an open core issue to add validation to content entities: https://www.drupal.org/node/2745797

With that patch, you can enable validation thusly:

destination:
  plugin: entity:node
  validate: true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.