It seems that currently Edit is unaware of Entity Translations, with every Quick Edit action saving changes to an original field value only.

Steps to reproduce:
* Enable Entity Translations module
* Enable 2 or more languages
* Enable entity translations (field-based) for a target content type & enable translations on a specific field (for example, 'field_body')
* Fill in both the original content & translation version with any data from back-end
* Preview the content from front-end and ensure that original & translations are displayed correctly by switching languages back & forth (for example, by using 'Switch Language' block)
* Switch to any language different than original one and perform Quick Edit action on content
* Change anything on target field & save
* Preview the content once again by switching languages -- Quick Edit update will overwrite the original field value (not the translated one)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

capnut’s picture

Component: User experience » Code
Category: Support request » Feature request
Shuairan’s picture

We struggled with the same issue...
Entity Translation loads the formLanguage from the entity handler in entity_translation_field_attach_form.
This seems to be not set by any module, so the function will always return the original language.

The appended patch changes the edit module to set the formLanguage to $langcode before field_attach_form is called, dont know if it breaks any other module or functions, we are testing this currently at our setup.

Feel free to test and report!

Wim Leers’s picture

Assigned: Unassigned » Gábor Hojtsy
Status: Active » Needs review

Assigning to Gábor for review.

Status: Needs review » Needs work

The last submitted patch, 2: edit-et-compatiblity-2237403-2.patch, failed testing.

Wim Leers’s picture

And of course, this patch will need to pass tests first.

Gábor Hojtsy’s picture

Assigned: Gábor Hojtsy » Unassigned
+++ b/includes/fape.inc
@@ -22,6 +22,10 @@ function edit_field_edit_form(&$form, &$form_state, $entity, $field_name) {
+  $handler = entity_translation_get_handler($entity_type, $entity);

You would certainly not call out to entity translation like this. This line of code would definitely not work on sites where the module is not even enabled. Look into either implementing this from the entity_translation side or using module_invoke() here.

Shuairan’s picture

okay, thanks for the hint :)

I totally missed that this is a entity_translation specific function... here is a new patch

capnut’s picture

The patch works indeed.
And not only title/body text fields but through the entity reference fields as well.

That's great!

Shuairan’s picture

Status: Needs work » Needs review

status back to Needs review, I think this very small patch is mandatory for Drupal7 with edit module and entity_translation.

Shuairan’s picture

Okay, seems to be still not fully fixed:
The entry in the entity_translation table will never be created.
And the "changed" value will not be updated if the translation is changed via edit module.

Wim Leers’s picture

Project: Edit » Quick Edit
Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Needs work
Issue tags: +Needs tests

NW per #10.

I'd also like to see test coverage. If that's not feasible, I want thorough manual testing reports.