date-5.x-2.3
views-5.x-1.6

When my CCK date fields are set to be exposed filters, they output correctly but do not filter. For example, if I have a node from January and 2 from February, selecting January and submitting still returns the February nodes. I thought this was just an upgrade issue however I did duplicate it on a fresh install of 5.8 (i don't think 5.10 would make a difference?).

Comments

Vuds’s picture

After little tests, I have found that I'm having this too. It's not related with Drupal version, though (mine is 5.10).

funkeyrandy’s picture

same issue here

jastraat’s picture

I'm having the same issue. In my case, I have a date field that only includes year, and when I try to filter an exposed filter by year, it gives me the error that it isn't a valid date.

I think the problem involves these lines from date_views.inc:

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

$value at this point is just the 4 character string for the year, and it won't match the DATE_REGEX_LOOSE regular expression, so it's set to blank. When I commented out these lines, the filter works. (Obviously, I don't think this is a permanent solution!) Thoughts?

funkeyrandy’s picture

this still doesnt do anything for me...i have year month day pulldowns, and i want to filter by "equal to: month", leaving the other two pulldowns blank...it wont accept that !

i tried above code, but no change...

thanks!

r

karens’s picture

Status: Active » Fixed

There were numerous duplicate issues about this, it is fixed in -dev.

Status: Fixed » Closed (fixed)

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