Download & Extend

NO_LANGUAGE isn't being replaced with 'und'

Project:Internationalization Views
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I don't know if this is a bug or something I'm doing wrong, but I created a view to show taxonomy terms. In the generated query, NO_LANGUAGE isn't being replaced with 'und'.

The view has this filter: "Taxonomy term: Language". On the settings for that filter, I checked "Current user's language" and "No language". This is the resulting query (the arguments were replaced with their values by the devel module):

SELECT taxonomy_term_data.name AS taxonomy_term_data_name, taxonomy_term_data.vid AS taxonomy_term_data_vid, taxonomy_term_data.tid AS tid, taxonomy_vocabulary.machine_name AS taxonomy_vocabulary_machine_name, taxonomy_term_data.description AS taxonomy_term_data_description, taxonomy_term_data.format AS taxonomy_term_data_format, taxonomy_term_data.weight AS taxonomy_term_data_weight, 'taxonomy_term' AS field_data_field_owning_company_taxonomy_term_entity_type, 'taxonomy_term' AS field_data_field_which_column_taxonomy_term_entity_type FROM taxonomy_term_data taxonomy_term_data LEFT JOIN taxonomy_vocabulary taxonomy_vocabulary ON taxonomy_term_data.vid = taxonomy_vocabulary.vid WHERE (( (taxonomy_vocabulary.machine_name IN ('manufacturer')) AND (taxonomy_term_data.language IN ('en', '***NO_LANGUAGE***')) )) ORDER BY taxonomy_term_data_weight ASC

When I replace "***NO_LANGUAGE***" with "und", it works as expected.

I tried this with 7.x-3.3 and with 7.x-3.x-dev of 2012-Jul-22; both have the same problem.

Is this a bug, or something I'm doing wrong?

Comments

#1

I "fixed" this using hook_query_alter(), which looks at the DatabaseCondition objects inside DatabaseCondition objects for '***NO_LANGUAGE***' and changes it to 'und'. But, hopefully there's a better way.

#2

Project:Views» Internationalization Views
Version:7.x-3.x-dev» 7.x-3.x-dev
Status:active» needs review

Well that's actually something which is done by views itself, mh.

This is a bug of i18nviews:

Here is some code of views:

    $languages = array(
        '***CURRENT_LANGUAGE***' => t("Current user's language"),
        '***DEFAULT_LANGUAGE***' => t("Default site language"),
        LANGUAGE_NONE => t('No language')
      );

and here the code of i18nviews:

      $this->value_title = t('Language');
      $languages = array(
        '***CURRENT_LANGUAGE***' => t("Current user's language"),
        '***DEFAULT_LANGUAGE***' => t("Default site language"),
        '***NO_LANGUAGE***' => t('No language')
      );
AttachmentSize
1698460-term-language.patch 774 bytes

#3

Status:needs review» fixed

Fixed. Commit 26bd52c on 7.x-3.x. Thanks!

#4

Status:fixed» closed (fixed)

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