I had a View with two filters on the CCK date field:
- date is less than now + 604800. The 604800 was in the option field.
- date is greater than now.
These combined to give me everything taking place in the coming 7 days.

Following upgrade, today's date and time is in the Value field for both filters, and 604800 is in the option field for the first.
The view seems to show me EVERYTHING.

Comments

karens’s picture

Status: Active » Fixed

The -rc version is out of date. If you want to report bugs, first see if things are fixed in the latest code, the -dev version. There have been lots of changes to the filters since the rc version and it should be working fine there.

joachim’s picture

Status: Fixed » Active

I'm getting the same problem with today's -dev version.

joachim’s picture

In fact, it's worse than with the RC release.

After I update the fields to the new format, I get no results.
It looks like this filter doesn't work properly:
- date is less than "now +1 week" in the option field
It's getting treated as simply "now".

jesss’s picture

Version: 5.x-2.0-rc » 5.x-2.x-dev

I'm having this same issue in 5.x-2.x-dev. I'm trying to show board meetings from the last six months (>= now -6 months), but the MySQL query is selecting >= NOW().

Here's the export of my view.

  $view = new stdClass();
  $view->name = 'about_boardmeetings_past';
  $view->description = 'Previous board meetings';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'Previous meetings';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'list';
  $view->url = '';
  $view->use_pager = FALSE;
  $view->nodes_per_page = '0';
  $view->sort = array (
    array (
      'tablename' => 'node_data_field_board_meeting_date',
      'field' => 'field_board_meeting_date_value',
      'sortorder' => 'DESC',
      'options' => '',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'nid',
      'label' => '',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'board_meeting',
),
    ),
    array (
      'tablename' => 'node_data_field_board_meeting_date',
      'field' => 'field_board_meeting_date_value_default',
      'operator' => '>=',
      'options' => 'now -6 months',
      'value' => '',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node_data_field_board_meeting_date, node);
  $views[$view->name] = $view;

And here's the views_build_view query as displayed by the Devel module.

SELECT node.nid, node_data_field_board_meeting_date.field_board_meeting_date_value AS node_data_field_board_meeting_date_field_board_meeting_date_value FROM node node LEFT JOIN content_type_board_meeting node_data_field_board_meeting_date ON node.vid = node_data_field_board_meeting_date.vid WHERE (node.status = '1') AND (node.type IN ('board_meeting')) AND (node_data_field_board_meeting_date.field_board_meeting_date_value >= NOW()) ORDER BY node_data_field_board_meeting_date_field_board_meeting_date_value ASC

I tried applying jjohnsonBLC's suggestion from #247752: Filtering views with date-field (comment #18), but that didn't work.

karens’s picture

Status: Active » Fixed

The placement for 'now' and '+1' are in different places in the 5.2 code than they were in the 5.1 code, so you'll have to manually fix your filters. I just committed a number of fixes to the Views filters, so try again with the latest -dev code.

jesss’s picture

That worked. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

dkhorne’s picture

Status: Closed (fixed) » Active

Gidday,

I have just had the same problem except my filter was looking for a year in the CCK Date Field (e.g. Date: Date & Time - Year (field_date_time) is equal to 2008). It worked until I upgraded the dates module.

With a little searching I found teh culprit in date_views.inc at line 276

// Filter out 5.1 version values that won't work in 5.2.
if (!preg_match(DATE_REGEX_LOOSE, $value)) {
$value = '';
}

It did not like a value of "2008". What should it be to achieve the same results (e.g. return all nodes that have a 2008 date)?

cheers
David

karens’s picture

Status: Active » Fixed

This looks like a duplicate of #338936: Date filters in Views stop working after upgrade, with only slightly more information than the other reports there. You've identified the same line others have identified and I guess it's something to do with a year filter, so I'll dig into that, but the latest post is still a duplicate.

Status: Fixed » Closed (fixed)

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