I created a profile field that is a selection of 5 different choices and I am trying to have views filter based on those choices. All that shows up in the drop-down in the view preview is "is one of" and "is not one of" but the actual choices do not show up. I would have filtered by role but when exposing the filter to the user so they get the drop-down it shows all the roles and not just those selected in the filter. Any idea of what I am doing wrong?

I have attached a screenshot of the drop-down and pasted the export of the view below.

$view = new view;
$view->name = 'committee_members';
$view->description = 'Block of current committee members';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'users';
$view->is_cacheable = '0';
$view->api_version = 2;
$view->disabled = FALSE; // Edit this to true to make a default view disabled initially
$view->display = array();
  $display = new views_display;
  $display->id = 'default';
  $display->display_title = 'Defaults';
  $display->display_plugin = 'default';
  $display->position = '1';
  $display->display_options = array (
  'style_plugin' => 'default',
  'style_options' => 
  array (
  ),
  'row_plugin' => 'fields',
  'row_options' => 
  array (
  ),
  'relationships' => 
  array (
  ),
  'fields' => 
  array (
    'picture' => 
    array (
      'id' => 'picture',
      'table' => 'users',
      'field' => 'picture',
      'label' => 'Picture',
    ),
    'name' => 
    array (
      'id' => 'name',
      'table' => 'users',
      'field' => 'name',
      'label' => 'Name',
      'link_to_user' => true,
    ),
    'value' => 
    array (
      'id' => 'value',
      'table' => 'profile_values_profile_position',
      'field' => 'value',
      'label' => 'Position',
    ),
    'mail' => 
    array (
      'id' => 'mail',
      'table' => 'users',
      'field' => 'mail',
      'label' => 'E-mail',
      'link_to_user' => 'mailto',
      'relationship' => 'none',
    ),
  ),
  'sorts' => 
  array (
  ),
  'arguments' => 
  array (
  ),
  'filters' => 
  array (
    'value' => 
    array (
      'id' => 'value',
      'table' => 'profile_values_profile_committee',
      'field' => 'value',
      'operator' => 'in',
      'value' => 
      array (
        'ARC' => 'ARC',
        'Communications Committee' => 'Communications Committee',
        'Governance Committee' => 'Governance Committee',
        'Grounds Committee' => 'Grounds Committee',
        'Board of Directors' => 'Board of Directors',
      ),
      'group' => 0,
      'exposed' => true,
      'expose' => 
      array (
        'operator' => 'value_oper',
        'identifier' => 'value',
        'label' => 'Profile: Member of',
        'optional' => 0,
        'single' => 1,
        'remember' => 0,
      ),
      'relationship' => 'none',
      'expose_button' => 
      array (
        'button' => 'Hide',
      ),
    ),
  ),
  'items_per_page' => 10,
);
$view->display['default'] = $display;
  $display = new views_display;
  $display->id = 'block';
  $display->display_title = 'Block';
  $display->display_plugin = 'block';
  $display->position = '2';
  $display->display_options = array (
  'defaults' => 
  array (
    'access' => true,
    'title' => true,
    'header' => true,
    'header_format' => true,
    'header_empty' => true,
    'footer' => true,
    'footer_format' => true,
    'footer_empty' => true,
    'empty' => true,
    'empty_format' => true,
    'use_ajax' => true,
    'items_per_page' => true,
    'offset' => true,
    'use_pager' => true,
    'pager_element' => true,
    'use_more' => true,
    'distinct' => true,
    'link_display' => true,
    'style_plugin' => true,
    'style_options' => true,
    'row_plugin' => true,
    'row_options' => true,
    'relationships' => true,
    'fields' => true,
    'sorts' => true,
    'arguments' => true,
    'filters' => true,
  ),
  'relationships' => 
  array (
  ),
  'fields' => 
  array (
  ),
  'sorts' => 
  array (
  ),
  'arguments' => 
  array (
  ),
  'filters' => 
  array (
  ),
);
$view->display['block'] = $display;
CommentFileSizeAuthor
viewexample.jpg54.49 KBlokineo

Comments

merlinofchaos’s picture

It turns out that the filter identifier cannot be 'value' -- if you change that to something else, then it should start working. I'm not sure why 'value' doesn't work offhand (though it's a really common keyword in filters so it may be that it's getting screwed up somewhere). What an annoying little issue.

lokineo’s picture

I am a complete php n00b. What should I replace 'value' with? Oh, and thank you!

merlinofchaos’s picture

Anything you like, really. That string is going to show up in the query portion of the URL to identify that filter; so something that matches the name of your filter would be best. (i.e, http://www.example.com/view?value=foobar)

merlinofchaos’s picture

Title: Won't filter by custom profile field » 'value' is not a valid filter identifier

Changing the title so this is easier for me to spot.

lokineo’s picture

It worked! Thanks.

merlinofchaos’s picture

Status: Active » Fixed

I've added validation code to -dev to deal with this; I tried to make 'value' legal, but it can't be done.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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