I have a content type with multilingual support disabled. I just upgraded to the latest dev and now the language selector widget is showing up on the node edit form, along with the (all languages) hints. This is particularly embarrassing since any authenticated user is supposed to be able to use this form.

The new interface is working great on node types where I want translation enabled... but I don't want it popping up where it's supposed to be disabled!

Comments

joelrosen’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

Here's a patch.

It looks like you guys forgot to check if the bundle had ET enabled in entity_translation_entity_form_get_handler? This seems to fix things. I hope you can take a look before releasing a beta.

plach’s picture

Status: Needs review » Needs work

Thanks for reporting!

+++ b/entity_translation.module
@@ -1681,7 +1681,11 @@ function entity_translation_entity_form_get_handler($form, &$form_state) {
+    $entity_info = entity_get_info($info['entity type']);

Please, use entity_extract_ids() to get the entity bundle.

+++ b/entity_translation.module
@@ -1681,7 +1681,11 @@ function entity_translation_entity_form_get_handler($form, &$form_state) {
+    if (entity_translation_enabled($info['entity type']) &&
+        entity_translation_enabled_bundle($info['entity type'], $info['entity']->{$entity_info['bundle keys']['bundle']}) &&
+        !entity_translation_node($info['entity type'], $info['entity'])) {
       $handler = entity_translation_get_handler($info['entity type'], $info['entity']);

For consistency with the rest of code we should keep this on one line.

joelrosen’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

Ah wonderful, didn't know about entity_extract_ids.

plach’s picture

Status: Needs review » Fixed

Committed and pushed, thanks!

joelrosen’s picture

Thanks for taking care of this so quickly!

Small thing, but is it possible for you to attribute me as the author for this commit? It's not a big deal but it's nice to get credited. Thanks.

plach’s picture

Usually I do, but this time I typed the wrong command. Really sorry about that :(

Next time I certainly will :)

However you've been credited in the changelog.

plach’s picture

Issue tags: +Needs tests

This will need test coverage.

Status: Fixed » Closed (fixed)

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

guillaumev’s picture

Status: Closed (fixed) » Active

I'd like to reopen this as I see the following behaviour, on a site with only one language (English) after a clean standard Drupal installation, on content types with "Multilingual support" set to Disabled:

  • After enabling Locale, the language selector widget does not appear
  • After enabling Entity Translation, a language selector widget appears with the following options: "Language neutral", "English"

This language selector should not appear given that the "Multilingual support" of this content type is disabled.

Note that I'm using the latest dev version of entity_translation.

guillaumev’s picture

Status: Active » Closed (fixed)

Closing this as I created another issue: http://drupal.org/node/1933022

  • Commit 61700e6 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions by plach:
    Issue #1811672 by joelrosen: Fixed Entity translation stuff showing on...

  • Commit 61700e6 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions, workbench by plach:
    Issue #1811672 by joelrosen: Fixed Entity translation stuff showing on...