Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Fatal error when importing translation which includes new embedded entities #80

Closed
iamEAP opened this issue Nov 25, 2015 · 1 comment
Closed
Labels

Comments

@iamEAP
Copy link
Contributor

iamEAP commented Nov 25, 2015

Suppose you have a set of nodes that are part of a translation set...

Suppose you then add a field collection or paragraph item field to the content type, and populate the field collection / paragraph on the source language node.

If you export an XLIFF file from the source language, then attempt to import a translation, you will get an error like the following:

Recoverable fatal error: Argument 1 passed to EntityXliff\Drupal\Translatable\Content\FieldCollectionTranslatable::getHostEntity()
must be an instance of FieldCollectionItemEntity, boolean given,
called in /path/to/src/Drupal/Translatable/Content/FieldCollectionTranslatable.php on line 57
and defined in EntityXliff\Drupal\Translatable\Content\FieldCollectionTranslatable->getHostEntity()
(line 118 of /path/to/src/Drupal/Translatable/Content/FieldCollectionTranslatable.php).

Because, when it attempts to set the new embedded entity content values on the existing translation, it has no entity to set against...

This is not a problem for net-new translations in a set because the original content of the embedded entities is first duplicated.

@iamEAP
Copy link
Contributor Author

iamEAP commented Nov 26, 2015

Further investigation reveals this to be true for entity references as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant