Since the v7.x-2.9 release cycle the exposed filters have automatically assigned a value, even when one is not requested.

The bug was introduced in #2309015: views date field exposed filter default value not being added in $form_state['input'] when initially views loads.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Michelle’s picture

In #2309015: views date field exposed filter default value not being added in $form_state['input'] when initially views loads there are two patches. The second patch adds on code to the first patch with the note that the first patch caused a fatal error. However, the code in the second patch is setting a default value where it shouldn't be. When I tried removing that code entirely, I didn't get any errors so I couldn't figure out what the additional code was trying to fix. Instead of removing it completely, though, this patch keeps the part of the code that initializes the array elements but sets them to NULL rather than today's date. Later on in the code, outside of the patched part, it is correctly setting the value to the default chosen in the Views UI.

DamienMcKenna’s picture

Status: Active » Needs review
andrewbelcher’s picture

This appears to solve the issue for me. Filters without a default no longer have a default and filters with a default work correctly. I'm not going to mark as reviewed as I don't know the code well enough to know whether it will have other issues.

stefan.r’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

Patch looks good. Upgrading priority as it can break existing views after a module upgrade.

  • vijaycs85 committed dd66a64 on 7.x-2.x authored by Michelle
    Issue #2420323 by Michelle: Exposed date filter shouldn't automatically...
vijaycs85’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all.

Status: Fixed » Closed (fixed)

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