Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IndexBundle] Range Filter does not work if min or max value is 0 #1602

Closed
ychanan opened this issue Mar 23, 2021 · 1 comment
Closed

[IndexBundle] Range Filter does not work if min or max value is 0 #1602

ychanan opened this issue Mar 23, 2021 · 1 comment

Comments

@ychanan
Copy link
Contributor

ychanan commented Mar 23, 2021

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

If min value (and/or max value) in the range is zero (e.g. 0-500), the RangeFilterConditionProcessor skips applying the condition to the list.

As seen in the RangeFilterConditionProcessor::addCondition() method:

if (!empty($valueMin) && !empty($valueMax)) {
    $fieldName = $field;

    if ($isPrecondition) {
        $fieldName = 'PRECONDITION_' . $fieldName;
    }

    $list->addCondition(new RangeCondition($field, $valueMin, $valueMax), $fieldName);
}

Pull request: #1606

@dkarlovi
Copy link
Contributor

Right, I don't see why 0 should be anything special, min can easily be negative, the range should check for !== null probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants