The label "Date value" is always showing up under the real label as soon as I expose any kind of date filter in views. Please look at the attached image.

I have been looking around for this bug but I really can't find anything so I will report it.

Comments

nagiek’s picture

Hi, I would like to see this fixed too. Problem is that date_parts_form() in date_views_filter_handler_simple.inc sets a title without checking for an existing label. You can include the following code at the start of the function to override if you want. I'm no good at making patches, but if someone wants to create one..?

I honestly think the best solution is to just have one label, not two.

 function date_parts_form($form_state, $prefix, $source, $which, $operator_values, $identifier, $relative_id) {
    module_load_include('inc', 'date_api', 'date_api_elements');
    if (!empty($this->options['expose']['label'])) {
      $relative_label = $this->options['expose']['label'];
      $label = NULL;
    } else {
      switch($prefix) {
        case 'min':
          $label = t('Start date');
          $relative_label = t('Relative start date');
          break;
        case 'max':
          $label = t('End date');
          $relative_label = t('Relative end date');
          break;
        default:
          $label = t('Date value');
          $relative_label = t('Relative date');
          break;
      }
    }
nagiek’s picture

Status: Active » Needs review
whop’s picture

me too :D
thanks

Mangostaniko’s picture

This is just what i need – thank you – , but (i'm quite new to Drupal) where exactly do i put this code?

nagiek’s picture

Problem is that date_parts_form() in date_views_filter_handler_simple.inc

In the date_parts_form() function, found in date_views_filter_handler_simple.inc. This is in the date -> date_views -> includes folder. Usually .inc files are kept in that folder, if not in the main directory.

Mangostaniko’s picture

Title: "Date value" label showing up in exposed filter » Solution via Translate Interface

Thank you!
Anyway, I found a different solution to make the label disappear:

  1. Go to Configuration » Regional and language » Translate interface
  2. There you search for "Date value" (CaseSensitive!)
  3. Enter any translation for your default language (I used a space " ")

EDIT: Soorry! It seems i just changed the title of this page... Unfortunately I don't remember what it was like..

jesss’s picture

Title: Solution via Translate Interface » "Date value" label showing up in exposed filter

Fixing the title....

KarenS’s picture

Status: Needs review » Fixed

I think the labels are necessary when you use the between or not between operators, otherwise you have nothing that tells you one is the start and the other the end date. But we could get rid of the extra label for the other operators.

nagiek’s picture

Yeah that's the best idea.

It's funny, I just made a view that exposed both start and end dates, and was thinking "OK, this doesn't make sense any more". So two labels only when two dates exposed.

Status: Fixed » Closed (fixed)

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