Bug found in the functionality for:
Expose the field language column for translatable fields
https://drupal.org/node/1515156

Currently experiencing a bug in the view admin gui where on a situation you need to add in field language for a translatable field that is a "checkbox" field. Using filter language for the said translatable field does not show the desired form field of choosing language but instead shows the checkbox option form asking which value to select.

Comments

chriscalip’s picture

Also translatable fields that are checkboxes seem to trigger an explosion of duplicate records and adding filters like the one provided @ https://drupal.org/node/1515156 does not seem to work :(

leon kessler’s picture

I found similar issues with taxonomy term fields. You get the same filter options when adding a language filter as when you add the field itself.

Anyway, dug into Views a little bit, couldn't quite work out exactly what was going on, but it seems as though there are several field types that get their handler applied after field_views_field_default_views_data() (line 425). So the views_handler_filter_locale_language handler (that gives you the correct language filter options) is being overridden somewhere.

Anyway, I've got this temporary fix for it that I've put into a custom module that seems to do the trick.

function mymodule_views_data_alter(&$data) {
  foreach ($data as $field => $info) {
    if (isset($info['language']) && isset($info['language']['filter']) && $info['language']['filter']['handler'] != 'views_handler_filter_locale_language') {
      $data[$field]['language']['filter']['handler'] = 'views_handler_filter_locale_language';
    }
  }
}  
gascon’s picture

Issue summary: View changes

That works like charm, @Leon Kessler! Thanks for the contribution :D