Actual value instead of label displayed in views.

In blah => t('Blah'), "blah" is displayed in the view instead of "Blah".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mradcliffe’s picture

This is because views grabs labels from allowed values. May need to override this specifically.

mradcliffe’s picture

This is tricky. It looks like I'll have to alter views data via hook_views_data_alter. I cannot effect a field's views data from the widget side. It'd be nice if there was a hook_field_settings_alter, but I guess that would slow things down.

mradcliffe’s picture

#957342: Exposed View widget not showing as Selectbox marked as a duplicate of this issue.

Edit: no, it's similar, and would require similar work around in views.

mradcliffe’s picture

Status: Active » Needs review

This should be fixed in the dev version.

Scryver’s picture

This still happens in version 7.x-dev. I'm working with panels, but only when I make the field editable it displays the right label, else it will display the key.
--Edit: It is not only in panels it's every where the field is displayed. Is it the hook_field_formatter_view() that is missing?

mradcliffe’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
FileSize
1.85 KB

Thank you for the suggestion, Scryver. field formatter is the correct way to go here.

This patch is for 7.x-1.x

mradcliffe’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Patch (to be ported)