I created a custom field as List (text), widget: Check boxes/radio buttons. Editing the field I have for Allowed values list:

live_music|Live Music

On the search page it should show for filter "Live Music" like it is shown when editing the content. However, it shows the key "live_music"

CommentFileSizeAuthor
#3 1150988-2.patch3.74 KBpwolanin

Comments

pwolanin’s picture

Title: Block for serch filters based on custom fields displaying field keys instead of labels » Block for search filters based on custom fields displaying field keys instead of labels

Yes, I'm seeing that too - unfortunately I think this may require a fix to facetapi too, since it doesn't look like it allows the map callback to take added arguments.

For apachesolr before we had this function:

/**
 * Use the list.module's list_allowed_values() to format the
 * field based on its value ($facet).
 *
 *  @param $facet string
 *    The indexed value
 *  @param $options
 *    An array of options including the hook_block $delta.
 */
function apachesolr_fields_list_display_callback($facet, $options) {
  // @see list_field_formatter_view()
  $fields = field_info_fields();
  $field_name = $options['delta'];
  if (isset($fields[$field_name])) {
    $allowed_values = list_allowed_values($field);
    if (isset($allowed_values[$facet])) {
      return field_filter_xss($allowed_values[$facet]);
    }
  }
  else {
    return $facet;
  }
}

cpliakas’s picture

Issue and patch posted against Facet API at #1151086: Implement a map options key in the facet definition.

pwolanin’s picture

Version: 7.x-1.0-beta6 » 7.x-1.x-dev
Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new3.74 KB

This fix requires this change to facetapi: http://drupal.org/node/1151086#comment-4442756

pwolanin’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

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