tableau-mkt-archived / entity_xliff

Drupal module that provides an API for entity serialization in the XLIFF format.
https://drupal.org/project/entity_xliff
2 stars 0 forks source link

Uncaught cases where serialized vs. live structure have diverged #121

Open iamEAP opened 8 years ago

iamEAP commented 8 years ago

Problem / motivation

In situations where an entity reference field with no-cardinality is exported with a reference included, but then an import is attempted after the reference was removed, you run into a fatal PHP error of the form:

Call to a member function initializeTranslation() on null in 
/path/to/entity_xliff/src/Drupal/Translatable/EntityTranslatableBase.php on line 409

Proposed resolution

We should throw an EntityStructureDivergedException exception when we're unable to get a translatable in such cases (around line 408/409 of EntityTranslatableBase).