When using grouped exposed filters, the form validation allows "0" values, but when re-editing the filter settings, the 0 values are gone and the form no longer passes validation. I think this issue may have been originally reported by @abtm in #731662-138: Hybrid Exposed Filters.

I'll attach a test to demonstrate the issue, haven't looked into a fix yet.

Comments

star-szr’s picture

StatusFileSize
new2.98 KB

Here's the test, which also checks for the bug fixed in #731662-118: Hybrid Exposed Filters.

Status: Needs review » Needs work

The last submitted patch, views-1869728-1.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new4.13 KB
new2.98 KB

Here's a proposed fix. Added periods to the assertion messages as well.

star-szr’s picture

#3: views-1869728-3.patch queued for re-testing.

star-szr’s picture

#3: views-1869728-3.patch queued for re-testing.

chris matthews’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch does not apply to the latest views 7.x-3.x-dev.

Checking patch handlers/views_handler_filter.inc...
Hunk #1 succeeded at 996 (offset 49 lines).
Hunk #2 succeeded at 1004 (offset 49 lines).
Checking patch tests/views_exposed_form.test...
error: while searching for:
    $this->drupalPost(NULL, $edit, t('Apply'));
    $this->assertRaw(t('The title is required if value for this item is defined.'), t('Group items should have a title'));

    // Un-Expose the filter
    $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type');
    $this->drupalPost(NULL, array(), t('Hide filter'));

error: patch failed: tests/views_exposed_form.test:150
error: tests/views_exposed_form.test: patch does not apply
Checking patch tests/views_test.views_default.inc...
andrew answer’s picture

StatusFileSize
new4.13 KB

Patch re-rolled.

andrew answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
andrew answer’s picture

I found next problem related to this bug. I tried to use last dev version of Views with patch #7, exposed filter edited fine now, but it not work. The problem: I have INT column in DB with values (0,1) and I add grouped exposed select filter with two options (=0 and =1) to view, first option doesn't filter values at all. When I change order of options (=1 and =0), second option show me zero records. But, if this filter is not exposed, all looks fine.

andrew answer’s picture

StatusFileSize
new4.68 KB

Incredible, but after several hours of debugging I fixed this annoying bug! Patch is updated.

damienmckenna’s picture

@Andrew: Could you please provide an interdiff for the change? Thanks.

andrew answer’s picture

StatusFileSize
new667 bytes
damienmckenna’s picture

Ah! Thanks.

andrew answer’s picture

StatusFileSize
new4.68 KB

Patch rerolled/fixed after last commits.

Status: Needs review » Needs work

The last submitted patch, 14: views-fix_zero_values-1869728-14.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.