This is sort of related to #2019871: Label for "is between" secondary filters missing, but not exactly.

When a filter is made into a "Secondary option", the title and description of that option fail to render. In the code that copies the filter into the $secondary array, the title is copied over (though not the description), but since $secondary[$identifier] doesn't have a type of it's own, it is rendered as a "markup" form element which does not accept #title or #description as a property (see documentation).

The way the code is now, the BEF filter looks roughly like (warning, psuedo-array!):

array(
  '#title' => 'BEF label',
  'min' => array(
    '#title' => '',
    // ...
  ),
  'max' => array(
    '#title' => 'And',
  ),
  '#bef_description' => 'Some descriptive text.',
)

I have attached a patch which adds $secondary[$identifier]['#type'] = 'item';, and it copies the description from '#bef_description' (or $form['#info'][$filter_key]['description'] as a fallback).

That brings up one more question... why is there a description in the BEF options form when the filter form has it's own description field? Seems sort of redundant to me, but I'd like to hear the reasoning behind it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hargobind’s picture

FileSize
952 bytes

Patch for 7.x-3.x-dev

mikeker’s picture

That brings up one more question... why is there a description in the BEF options form when the filter form has it's own description field? Seems sort of redundant to me, but I'd like to hear the reasoning behind it.

The short answer is that the BEF description field was implemented before the Views description field was. The BEF description also allows for token replacements that the stock Views one does not. However, you're correct that it now leads to confusion -- and if you enter text into both, you get two description fields on the filter.

Unfortunately, this leaves us in a bit of a UX mess.... We can't remove one of the two without leaving some users screwed. Though it may be worth it to warn users about the competing description fields.

Haven't had a chance to look at the patch -- thank you for that! -- I hope to do that in the next few days.

mikeker’s picture

I've fixed the part that the title and description don't render correctly in secondary filters (different approach than was taken in the patch). I've added a followup issue (#2482161: There are two description fields and that causes confusion) to address the multiple description options.

  • mikeker committed 1134309 on 7.x-3.x
    Issue #2429309: Secondary filters don't display Title and Description
    

Status: Fixed » Closed (fixed)

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