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

Form filter - Also search for NULL values when empty string is checked #5269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mdouchin
Copy link
Collaborator

@mdouchin mdouchin commented Jan 27, 2025

In Lizmap form filter, you can use a field containing several values by configuring a "Unique values" field type.
Lizmap show a list of checkboxes which allow the user to check which values should be used for the filter. For example:

image

In the example above, the checkbox with no label corresponds to the features which have a NULL value for this field.

This modification fixes the previous behaviour which triggered a filter "acces" IN ( '' ) by adding a test on the NULL value. The new filter is the correct : ( "acces" IN ( '' ) OR acces IS NULL )

Funded by Destination Bretagne Sud - Golfe du Morbihan https://destination-bretagnesud.bzh/

@mdouchin mdouchin self-assigned this Jan 27, 2025
@github-actions github-actions bot added this to the 3.10.0 milestone Jan 27, 2025
@mdouchin mdouchin added the run end2end If the PR must run end2end tests or not label Jan 27, 2025
@mdouchin
Copy link
Collaborator Author

cc @Gustry FYI

@nboisteault
Copy link
Member

@mdouchin I don't think there will be a new Lizmap 3.7 release, so the backport tag is unnecessary cc @Gustry
Could you add a test?

@Gustry Gustry force-pushed the fix_form_filter_unique_null_values branch from d7c3984 to c910777 Compare January 27, 2025 16:49
@Gustry
Copy link
Member

Gustry commented Jan 28, 2025

For some tests, the best would be some basic JavaScript function to be able to use JSUnit.

To be inspired from Lizmap server to format SQL query, according to a list of parameters :

I know it's not easy in this "legacy" JS file, just the idea

@Gustry
Copy link
Member

Gustry commented Jan 28, 2025

@mdouchin I don't think there will be a new Lizmap 3.7 release, so the backport tag is unnecessary cc @Gustry

Yes, according to the initial planning https://github.com/3liz/lizmap-web-client/wiki/Versions#diagram

We decided to have less overlap between branches. As 3.8.0 has been released in September 2024 and we are already at 3.8.4, we considered 3.8.X to be stable enough and to not maintain an too many branches in parallel. 3.7 should be already EOL since december, we added one extra release in January.

image

@mdouchin
Copy link
Collaborator Author

@rldhont @nboisteault OK to merge ?

NB: I removed to backport-3.7 tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_3_8 backport release_3_9 bug filter forms javascript Pull requests that update Javascript code run end2end If the PR must run end2end tests or not
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants