Skip to content

Added a filter for projections over StringFields that allows returnin… #8226

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

Conversation

LorenzoFrediani-Laser
Copy link
Contributor

Added a filter for projections over StringFields that allows returning all items when the provided value is empty.

Add a ContainsAllifProvided filter to get All items if no "filter" is selected
this solve the #8225 issue

…g all items when the provided value is empty.

Add a ContainsAllifProvided filter to get All items if no "filter" is selected
this solve the OrchardCMS#8225 issue
@BenedekFarkas
Copy link
Member

BenedekFarkas commented Jun 19, 2019

I see this is a follow-up to #8213. Actually, I think this should be a completely separate option for all types of data, not just strings: A common checkbox for all FieldTypeEditors that (when checked/enabled) does not run the filter if the provided value is empty, which can be quite common if you use a Token (e.g. filter by a query string parameter). I did something similar in Lombiq.Projections (NullSafeStringFieldTypeEditor), but it only applies to strings and is a separate filter.
To have this generalized could be a nice improvement to this feature, what do you think?

@LorenzoFrediani-Laser if I understand correctly, this would also cover your case, because ContainsAll and ContainsAny already exists, so you'd have to just update the filters with this option enabled.

@MatteoPiovanelli
Copy link
Contributor

@BenedekFarkas I think what you are proposing makes sense for dev perhaps? I would merge this PR here in 1.10.x

@BenedekFarkas
Copy link
Member

BenedekFarkas commented Apr 10, 2024

That only works with those two specific cases. What I'm suggesting above is a simple, generic solution that can be applied to any filter (and when applied to a filter, it works regardless of what the rest of its configuration is).
I'll give it try and see if that indeed works for you too as expected.

@BenedekFarkas
Copy link
Member

Please see #8781.

@BenedekFarkas
Copy link
Member

Closing this as #8781 covers the desired functionality: Use the ContainsAll value for Operator and the new checkbox (IgnoreFilterIfValueIsEmpty).

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.

Return all items by projection in ContainsAll if provided value is empty
3 participants