Values added to the

Text to appear as the "all" option (non-field widgets only)

input do not appear on the global filter block
even if an Alternatively specify a default through PHP code is added.

Comments

doppel’s picture

I just implemented a theme hook form alter.

function YOURTHEME_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'global_filter_1':
      $modified_options = array();
      foreach ($form['select_name']['#options'] as $option) {
        if ($option == '') {
          $modified_options['$option'] = 'All Locations';
        }
        else {
          $modified_options['$option'] = $option;
        }
      }
      // Assign the new modified options:
      $form['select_name']['#options'] = $modified_options;
      break;
  }

let know if there are another way around. Thanks!

RdeBoer’s picture

Hmm... this should work without your code....
Will have to look into this sometime soon.
Rik

errand’s picture

Hmm.. Doesn't work even with this code

RdeBoer’s picture

Title: Text to appear as the "all" option (non-field widgets only) Not appearing » 'Text to appear as the "all" option (non-field widgets only)' Not appearing
Assigned: Unassigned » RdeBoer
Priority: Critical » Normal

Heads up: will be looking at this this week.

RdeBoer’s picture

Status: Active » Closed (cannot reproduce)

To me this works fine. Both the label and the "All" option displayed to the user can be configured for drop-down selects.
Please demonstrate your issue with a full, reproducible test case, as I cannot reproduce this on my test system.