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

DARK:Enhance Value Checking Mechanism in Filter Processing #1

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

Othman-Charai
Copy link
Contributor

@Othman-Charai Othman-Charai commented Mar 11, 2024

Description:
This PR addresses two main issues in our filter processing:

  • Fixes the handling of zero values (0, 0.0, "0") mistakenly considered empty by empty(). This is crucial for correctly
    processing enum integer values, especially when 0 is a valid enum.
  • Refines the use of isset() to include $filters['value'] = null in processing, acknowledging that filtering by null can be
    intentional and should be supported.

Outcome:

  1. Zero values are now correctly processed, ensuring accurate filtering.
  2. null values are intentionally included, offering greater flexibility in filter criteria.

QA
Run the following :
./vendor/bin/pest Tests/QueryFilterTest.php

  • does 0 as filters[field] value supported context function check if 0 supported, before this change when you have value =0 then $queryFilter->getField() = null

@Othman-Charai Othman-Charai self-assigned this Mar 11, 2024
@Othman-Charai Othman-Charai merged commit 42d1571 into main Mar 11, 2024
2 checks passed
@Othman-Charai Othman-Charai deleted the dark-fix-zero-value-handling branch March 26, 2024 14:02
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

Successfully merging this pull request may close these issues.

2 participants