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

default strict=true for gridview filter (#19508) #19509

Merged

Conversation

alnidok
Copy link
Contributor

@alnidok alnidok commented Aug 20, 2022

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues #19508

Gridview filter behavior was changed #19508 after merge PR #19331

(!ArrayHelper::isTraversable($selection) && ($strict ? !strcmp($key, $selection) : $selection == $key)

because strict=false by default
$strict = ArrayHelper::remove($tagOptions, 'strict', false);


It means that we should add this code for every boolean column or numeric column with allowable value=0 (ie statuses)

'filterInputOptions' => [
    'class' => 'form-control',
    'strict' => true,
],

I think that it is a bug and strict should be true by default for GridView filters.
This PR do it.

@WinterSilence
Copy link
Contributor

👍🏻 this PR restore behavior changed by #19331 (BC)

@samdark samdark added this to the 2.0.47 milestone Aug 24, 2022
@samdark samdark added the type:bug Bug label Aug 24, 2022
@samdark
Copy link
Member

samdark commented Aug 24, 2022

Would you please add a line for CHANGELOG?

@samdark samdark merged commit d5e8849 into yiisoft:master Aug 24, 2022
@samdark
Copy link
Member

samdark commented Aug 24, 2022

Thanks.

@alnidok alnidok deleted the 19508-gridview-filter-for-boolean-columns branch August 24, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants