An entity can be not enabled for translation but at the same time may be sharing translatable fields with a translatable entity type or bundle. In this case a change in the entity language is not handled because the entity translation handler is not instantiated and tied to the entity form.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Needs review
FileSize
1.99 KB

Here is a patch performing only the language widget handling for untranslatable entities.

plach’s picture

+++ b/entity_translation.module
@@ -1416,6 +1424,11 @@ function entity_translation_entity_form_validate($form, &$form_state) {
+  // On non-transltable entities, we need to handle just the entity and field
+  // language.

Fixed typo.

plach’s picture

Status: Needs review » Reviewed & tested by the community
plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drzraf’s picture

Status: Closed (fixed) » Active

I got an issue using latest 7.x which wasn't happening using beta2. I now come here after the result of the bissection blamed 33651f45.

The issue is:

  • I use entity translation for a given bundle (type == report)
  • I use content translation for a given bundle (type == page)
  • I edit the french page node (n°1470) of type page at fr/node/1470/edit (several other translations already exist)

Result:

  • Before the commit default language is "french": this is correct
  • After the commit default language is "english": this is incorrect

Guess:
The hunk providing:
elseif ($info = entity_translation_edit_form_info($form, $form_state))
may be missing an additional test as, in my case, it succeeds while it probably must not.
If I understood that part of the code, this makes entity_translation the handler, but I believe that should not happens here.

Let me know if you need additional information.

plach’s picture

Status: Active » Closed (fixed)

I think I stumbled upon this as well, just forgot to open a new issue. Please open a new one and move #6 there as OP. Will meet you there :)

drzraf’s picture

  • Commit 33651f4 on 7.x-1.x, factory, et-fc, revisions by plach:
    Issue #1890346 by plach: Fixed Entity language change not handled on non...

  • Commit 33651f4 on 7.x-1.x, factory, et-fc, revisions, workbench by plach:
    Issue #1890346 by plach: Fixed Entity language change not handled on non...