You are here

function date_views_argument_handler::pre_query in Date 7

Make sure the date field is added to the query.

Do this in pre_query() so it will get done even if the argument is the wildcard, since query() is skipped when the wildcard is used.

Overrides views_handler::pre_query

File

date_views/includes/date_views_argument_handler.inc, line 278
Date API views argument handler.

Class

date_views_argument_handler
Date API argument handler.

Code

function pre_query() {

  // Unset invalid date values before the query runs.
  if (!empty($this->view->args) && count($this->view->args) > $this->position) {
    $argument = $this->view->args[$this->position];
    $parts = $this->date_handler
      ->arg_parts($argument);
    if (empty($parts[0]['date']) && empty($parts[0]['period'])) {
      unset($this->view->args[$this->position]);
    }
  }
}