the overlaps between ET and i18n continue to cause me no end of grief. wondering if limiting some of what ET does when it isn't being used would help?

for example, i am pretty sure if a node type is not set with: "Enabled, with field translation", then things like: "Filter comments per language" does not actually do anything. Is that correct?

Files: 
CommentFileSizeAuthor
#13 et-i18n_taxonomy-1661348-12.interdiff.txt1.64 KBplach
#13 et-i18n_taxonomy-1661348-12.patch10.02 KBplach
PASSED: [[SimpleTest]]: [MySQL] 721 pass(es).
[ View ]
#11 Tags___Drupal_7_x.png149.8 KBplach
#9 et-i18n_taxonomy-1661348-9.patch9.85 KBplach
FAILED: [[SimpleTest]]: [MySQL] 721 pass(es), 0 fail(s), and 203 exception(s).
[ View ]
#1 et-i18n_taxonomy-1661348-1.patch662 bytesplach
PASSED: [[SimpleTest]]: [MySQL] 62 pass(es).
[ View ]

Comments

plach’s picture

Title:ET UI alters shouldn't happen if node type isn't using ET» I18n Taxonomy integration
Category:bug» task
StatusFileSize
new662 bytes
PASSED: [[SimpleTest]]: [MySQL] 62 pass(es).
[ View ]

We need a far better integration with i18n_taxonomy, which right now is really confusing and not really working well. Attached there is a first stab at ensuring that at least the i18n_taxonomy and ET translation for taxonomy can work together.

We need an option in the vocabulary settings specifying that ET translation is enabled for that particular vocabulary.

plach’s picture

Status:Active» Needs review
plach’s picture

Status:Needs review» Active

Committed and pushed #1. Back to active.

bforchhammer’s picture

plach’s picture

I think we should simply define a 5th option in the vocabulary translation settings, explictly enabling ET for that particular bundle (we need to add a bundle callback for taxonomy).

mvdve’s picture

I agree. It would be amazing to have the same functionality as the node entity translations.
This would make the functionality generic and much easy-er to understand.
So an fifth option in the translation settings of the taxonomy vocabulary should be the best option.

This makes the import (with feeds) of multilingual taxonomy terms possible. You have to make a lot of custom functionality to make this happen now.

If I can help in any way, let me know.

  • Commit 82e3871 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions by plach:
    Issue #1661348 by plach | liquidcms: Fixed minimal i18n Taxonomy...

  • Commit 82e3871 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions, workbench by plach:
    Issue #1661348 by plach | liquidcms: Fixed minimal i18n Taxonomy...
plach’s picture

Issue summary:View changes
Status:Active» Needs review
StatusFileSize
new9.85 KB
FAILED: [[SimpleTest]]: [MySQL] 721 pass(es), 0 fail(s), and 203 exception(s).
[ View ]

This seems to be working correctly.

plach’s picture

We should probably add an update function.

plach’s picture

StatusFileSize
new149.8 KB

Here is a screenshot:

Status:Needs review» Needs work

The last submitted patch, 9: et-i18n_taxonomy-1661348-9.patch, failed testing.

plach’s picture

Status:Needs work» Needs review
StatusFileSize
new10.02 KB
PASSED: [[SimpleTest]]: [MySQL] 721 pass(es).
[ View ]
new1.64 KB

Slightly better patch.

plach’s picture

Priority:Normal» Major
Blacksnipe’s picture

I've tried both patches in #9 and #13. Here's my feedback:

When I leave the checkbox (not like the screenshot?) unchecked, it doesn't do a thing - works as expected.
But if I check it for a taxonomy, it gets my records in the entity_translation-table deleted whenever I try to save an edit!

plach’s picture

Are you sure you are not experiencing #2396103: [DATA LOSS] Translations deleted?

gonssal’s picture

So, I got to that point where you have a perfectly working translated taxonomy tree in a vocabulary, and then you have to edit the vocabulary, so all your default language terms are reset to 'und' language. It's so much enjoyable and fun. This breaks the entity translation, if I'm not mistaken, due to this in the entity_translation table:

entity_type | entity_id | language | source
taxonomy_term | 1 | ca | en
taxonomy_term | 1 | es | en
taxonomy_term | 1 | und | 

Also the 'language' column in the 'taxonomy_term_data' is set to 'und'.

This effectively breaks all the translations because their source language is no longer present. Apart from that, the Translate tab doesn't appear on the terms edit page (I guess it's because the term language is also set to 'und'), so you can't delete the translations. Even if you try to delete them by using "taxonomy/term/[tid]/translate/delete/[langcode]", it won't work. So basically everything breaks. The only what to get it "fixed" is executing UPDATE `taxonomy_term_data` SET `language` = 'en', where 'en' will be your site's default language. Even if you uncheck the "Hide language selector" and the "Exclude Language neutral from the available languages" options in the ET settings for the taxonomy term, it won't let you change the 'und' language because it gets one of the "orphan" translations instead of the 'und' entry.

I applied the patch on beta3 and got the following error:

Hunk #5 FAILED at 881.
1 out of 5 hunks FAILED -- saving rejects to file entity_translation.module.rej

I checked anyways and the new "Field translation. Term fields will be translated through the Entity translation module." option appeared, was selectable and it sucessfully saved the new setting. Sadly, nothing changed and my taxonomies were still "stuck".

I then updated to -dev, ran update.php and reapplied the patch. The new "Field translation..." option is not there now.

If I'm not mistaken, I think all of this mess would be resolved by fixing the #2366585: Saving a vocabulary resets all terms to LANGUAGE_NONE issue, and not the other way arround as you commented in there. I might be wrong though.

plach’s picture

Well, the idea is that this patch (that should be applied to the latest -dev) would prevent you from configuring your site in a way that triggers #2366585: Saving a vocabulary resets all terms to LANGUAGE_NONE. It can do nothing to recover data, sorry.

gonssal’s picture

So what happens when a user switches from Drupal's content translation to entity translation? I mean, there's even a migration submodule in ET that provides an "upgrade path".

Also, as I noted, even after applying the patch to the -dev version, the "Field translation. Term fields will be translated through the Entity translation module." option isn't appearing for me.

Don't get me wrong, I'm fine with looking at code, applying patches and running SQL queries, but I'm sure there's people getting crazy trying to understand what's happening with their taxonomy right now.

Nchase’s picture

applied the patch from #16 gave me two problems:

1. all Tag titles / descriptions were empty (using title module)
2. Views doesn't recognize the language selection (relationship + entity translation filter)

Nchase’s picture

views does recognize the language selection but when I configure a taxonomy view to display the taxonomy term names of a vocab I get the terms in the original language but the links to the translated language.

$view = new view();
$view->name = 'tagclouds';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'taxonomy_term_data';
$view->human_name = 'Tagclouds';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['group_by'] = TRUE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['inline'] = array(
  'name' => 'name',
  'name_1' => 'name_1',
);
/* Relationship: Taxonomy term: Content with term */
$handler->display->display_options['relationships']['nid']['id'] = 'nid';
$handler->display->display_options['relationships']['nid']['table'] = 'taxonomy_index';
$handler->display->display_options['relationships']['nid']['field'] = 'nid';
$handler->display->display_options['relationships']['nid']['label'] = 'Beitrag';
/* Relationship: Taxonomy term: Entity translation: translations */
$handler->display->display_options['relationships']['entity_translations']['id'] = 'entity_translations';
$handler->display->display_options['relationships']['entity_translations']['table'] = 'taxonomy_term_data';
$handler->display->display_options['relationships']['entity_translations']['field'] = 'entity_translations';
/* Field: COUNT(Taxonomy term: Name) */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['group_type'] = 'count';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['exclude'] = TRUE;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Field: Taxonomy term: Name */
$handler->display->display_options['fields']['name_1']['id'] = 'name_1';
$handler->display->display_options['fields']['name_1']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name_1']['field'] = 'name';
$handler->display->display_options['fields']['name_1']['label'] = '';
$handler->display->display_options['fields']['name_1']['alter']['text'] = '[name_field_et]';
$handler->display->display_options['fields']['name_1']['element_class'] = 'tags tag-[name] tag-dist-[counter]';
$handler->display->display_options['fields']['name_1']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['name_1']['link_to_taxonomy'] = TRUE;
/* Sort criterion: Global: Random */
$handler->display->display_options['sorts']['random']['id'] = 'random';
$handler->display->display_options['sorts']['random']['table'] = 'views';
$handler->display->display_options['sorts']['random']['field'] = 'random';
/* Filter criterion: Taxonomy term: Vocabulary */
$handler->display->display_options['filters']['vid']['id'] = 'vid';
$handler->display->display_options['filters']['vid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['vid']['field'] = 'vid';
$handler->display->display_options['filters']['vid']['value'] = array(
  7 => '7',
);
/* Filter criterion: COUNT(Taxonomy term: Name) */
$handler->display->display_options['filters']['name']['id'] = 'name';
$handler->display->display_options['filters']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['name']['field'] = 'name';
$handler->display->display_options['filters']['name']['group_type'] = 'count';
$handler->display->display_options['filters']['name']['operator'] = '>';
$handler->display->display_options['filters']['name']['value']['value'] = '0';
/* Filter criterion: Entity translation: Language */
$handler->display->display_options['filters']['language']['id'] = 'language';
$handler->display->display_options['filters']['language']['table'] = 'entity_translation';
$handler->display->display_options['filters']['language']['field'] = 'language';
$handler->display->display_options['filters']['language']['relationship'] = 'entity_translations';
$handler->display->display_options['filters']['language']['value'] = array(
  '***CURRENT_LANGUAGE***' => '***CURRENT_LANGUAGE***',
);

/* Display: Panel: Web tags */
$handler = $view->new_display('panel_pane', 'Panel: Web tags', 'panel_pane_1');

/* Display: Panel: Web tags en */
$handler = $view->new_display('panel_pane', 'Panel: Web tags en', 'panel_pane_2');
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: Taxonomy term: Content with term */
$handler->display->display_options['relationships']['nid']['id'] = 'nid';
$handler->display->display_options['relationships']['nid']['table'] = 'taxonomy_index';
$handler->display->display_options['relationships']['nid']['field'] = 'nid';
/* Relationship: Taxonomy term: Entity translation: translations */
$handler->display->display_options['relationships']['entity_translations']['id'] = 'entity_translations';
$handler->display->display_options['relationships']['entity_translations']['table'] = 'taxonomy_term_data';
$handler->display->display_options['relationships']['entity_translations']['field'] = 'entity_translations';
$handler->display->display_options['relationships']['entity_translations']['required'] = TRUE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: COUNT(Taxonomy term: Name) */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['group_type'] = 'count';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['exclude'] = TRUE;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Field: Taxonomy term: Name */
$handler->display->display_options['fields']['name_field']['id'] = 'name_field';
$handler->display->display_options['fields']['name_field']['table'] = 'field_data_name_field';
$handler->display->display_options['fields']['name_field']['field'] = 'name_field';
$handler->display->display_options['fields']['name_field']['label'] = '';
$handler->display->display_options['fields']['name_field']['exclude'] = TRUE;
$handler->display->display_options['fields']['name_field']['element_class'] = 'tags tag-[name] tag-dist-[counter]';
$handler->display->display_options['fields']['name_field']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['name_field']['settings'] = array(
  'title_style' => '_none',
  'title_link' => '',
  'title_class' => '',
);
$handler->display->display_options['fields']['name_field']['link_to_entity'] = 1;
/* Field: Taxonomy term: Name */
$handler->display->display_options['fields']['name_1']['id'] = 'name_1';
$handler->display->display_options['fields']['name_1']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name_1']['field'] = 'name';
$handler->display->display_options['fields']['name_1']['label'] = '';
$handler->display->display_options['fields']['name_1']['element_class'] = 'tags tag-[name] tag-dist-[counter]';
$handler->display->display_options['fields']['name_1']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['name_1']['link_to_taxonomy'] = TRUE;
$translatables['tagclouds'] = array(
  t('Master'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('Beitrag'),
  t('Translations'),
  t('[name_field_et]'),
  t('Panel: Web tags'),
  t('View panes'),
  t('Panel: Web tags en'),
  t('node'),
);

I don't know if this is a entity translation or a views problem.