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

Importing does not set correct values from the XLIFF file #75

Closed recrit closed 8 years ago

recrit commented 9 years ago

The import of an XLIFF file fails and does not set any values. The title gets set to "Title", body field to "Body", etc.

Version: 7.x-1.x 338de36

The following warnings are thrown during the import process:

Notice: Trying to get property of non-object in EggsCereal\Utils\ConverterToHTML->toHTML() (line 42 of /opt/development/rh/webdrupal/html/sites/all/vendor/tableau-mkt/eggs-n-cereal/src/Utils/ConverterToHTML.php).
Warning: Invalid argument supplied for foreach() in EggsCereal\Utils\ConverterToHTML->toHTML() (line 42 of /opt/development/rh/webdrupal/html/sites/all/vendor/tableau-mkt/eggs-n-cereal/src/Utils/ConverterToHTML.php).
iamEAP commented 9 years ago

Thanks for the report @recrit. I've seen this in the past as well, though I haven't investigated it fully. Is there a final, fatal error thrown? Do you see anything in watchdog other than those PHP notices/warnings?

Would you be able to supply a content type definition (e.g. via a features export) + a sample XLIFF to help reproduce?

recrit commented 9 years ago

There is no fatal error in the logs. There is just those 2 notices and then "Successfully imported node-123-zh.xlf."

I cannot provide any detailed information. It seems to consistently pull the "note" element of the group rather then any target vales.

The content type is fairly simple, no field collections. Field types used: Image, Long text and summary, Text, Term reference, Boolean, and Date.

Title group from XLIFF: `

EN BlogZH Blog Title `
iamEAP commented 9 years ago

I've noticed that this module can sometimes be finicky based on the order of the fields in the exported XLIFF file... Could you maybe provide a list of field types and the order they're in?

And are you using Entity Field Translation in Contrib or Content Translation from Drupal core?

recrit commented 9 years ago

Content Translation (translation module).

Fields:

Label,  Machine name,   Field type, Widget
Title,  title           

Image,  field_blog_image,   Image   Media browser   

Body,   body,   Long text and summary,  Text area with a summary    

CSS class,  field_css_class,    Text,   Text field  

By, field_blog_by,  Term reference, Autocomplete term widget (tagging)  

Blog Category, List,    field_blog_category,    Term reference, Select list 

Dateline,   field_dateline, Date,   Pop-up calendar 

Override, Default Analytics, Title, field_override_default_analytics,   Boolean Single on/off, checkbox 

Analytics, Title,   field_analytics_title,  Text,   Text field  
iamEAP commented 8 years ago

@recrit, check the latest dev snapshot for a fix for this.