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

Can't filter on "0" #242

Open
gbarat87 opened this issue Jan 12, 2024 · 2 comments
Open

Can't filter on "0" #242

gbarat87 opened this issue Jan 12, 2024 · 2 comments

Comments

@gbarat87
Copy link

When adding a filter, you can filter on any text or value, except on the value "0"

Here the control is done on the variable $filtersearchtext. If the value is "0", we won't reach the sql_replace() method, and the filter won't apply.
Maybe replacing this line with
isset($filtersearchtext)
or
isset($filtersearchtext) && $filtersearchtext != ''

@luisdev
Copy link

luisdev commented Jan 30, 2024

Can you explain the use case for wanting to filter on the value "0"? What field do you want to search for "0" in?

@luisdev
Copy link

luisdev commented Jan 30, 2024

$filtersearchtext is determined by the value of $data->idnumber. Is that referring to the idnumber value in the mdl_user table?

$filtersearchtext = optional_param('filter_searchtext_'.$data->idnumber, '', PARAM_RAW);

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

2 participants