From the docs for field_attach_validate:

> This function does not perform field widget validation on form submissions. It is intended to be called during API save operations. Use field_attach_form_validate() to validate form submissions.

This allows field modules to validate their data. For example, it prevents saving of list type fields with data that does not belong in the list.

This should be called before calling node_save() in the node destination, and similarly for other entity destinations.

Any FieldValidationException should be caught, and re-thrown as a normal Exception so the migration row fails.

Patch coming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Needs review
FileSize
1.32 KB
joachim’s picture

*sigh*

// Profile2 destination:
    entity_save($this->entity_type, $entity);

// EntityAPI destination:
    entity_save($this->entityType, $entity);

Consistent variable names matter!

Updated patch attached.