Skip to content

Fix/Keep other layers' filters when switching#6840

Open
meyerlor wants to merge 1 commit into
3liz:masterfrom
meyerlor:fix/6772-keep-other-layer-filters
Open

Fix/Keep other layers' filters when switching#6840
meyerlor wants to merge 1 commit into
3liz:masterfrom
meyerlor:fix/6772-keep-other-layer-filters

Conversation

@meyerlor
Copy link
Copy Markdown
Collaborator

@meyerlor meyerlor commented May 16, 2026

The form filter panel layer selector called deactivateFilter() on every change, which removed the filter already applied to the previously selected layer. Enabling a filter on a second layer therefore reset the first one.

Drop that call so each layer keeps its own filter, and recompute the selected layer's filter from filterConfig in launchLayerFilterTool() so the panel state stays consistent when switching back and forth.

Fixes #6772

FilterFix

@josemvm
Copy link
Copy Markdown
Collaborator

josemvm commented May 16, 2026

hi @meyerlor your PR reminded me of this observation issue #5366 about the filter tool.
Do you think developing this feature would be important, and would it be within your capabilities and skill set to implement it?

@josemvm
Copy link
Copy Markdown
Collaborator

josemvm commented May 16, 2026

i also have other issues related to this tool, for example: #1551 #1083 #2871 #2430

some of them may already be solved, and others might end up being solved by this PR as well

thank you very, very much ;-)

@meyerlor
Copy link
Copy Markdown
Collaborator Author

meyerlor commented May 16, 2026

hi @meyerlor your PR reminded me of this observation issue #5366 about the filter tool. Do you think developing this feature would be important, and would it be within your capabilities and skill set to implement it?

wait, i just tested this behaviour on my testserver, and it is working as you describe/wish for. Can you try it out and confirm that i understood correctly? :)

Those other reports seem interesting and solvable - i was a bit out for bughunting and searched for everything regarding the filter function during the last year back - as your issues are older than then, i did not find them. I will take a shot at them - but a bit more patience is needed for new features, for now i want to contribute to make 3.10 more stable 👍

@josemvm
Copy link
Copy Markdown
Collaborator

josemvm commented May 16, 2026

wait, i just tested this behaviour on my testserver, and it is working as you describe/wish for. Can you try it out and confirm that i understood correctly? :)

@meyerlor okay, i tested it on your server, and that’s exactly it - combining criteria in the filter regarding the same layer!

in my tests, i noticed that when I switch the filter between different layers, upon returning to a layer where i had already applied a filter, the filter has been cleared. perhaps this is another filter improvement that is not within the scope of this PR...

thank you very much for all the enthusiasm and the fantastic work you’ve been doing to improve the Lizmap project!

@meyerlor
Copy link
Copy Markdown
Collaborator Author

in my tests, i noticed that when I switch the filter between different layers, upon returning to a layer where i had already applied a filter, the filter has been cleared. perhaps this is another filter improvement that is not within the scope of this PR...

Ah, sh**t, my bad - I did not have this PR build live on my server, but another one. Now it is "Live" and that is exactly the scope of this PR.

  • combining different filters on the same layer (not in this PR but works on 3.10)
  • filtering layer A, then switching to layer B, applying filter there, going back to filter options of A -> Filters are still "on" and filter form also still shows the options you picked.

Always a pleasure to contribute!

@josemvm
Copy link
Copy Markdown
Collaborator

josemvm commented May 17, 2026

hi @meyerlor

Now it is "Live" and that is exactly the scope of this PR.

sorry for the noise, but my new tests show this:

meyerlor

Are you sure you already have your PR running on your server?
;-)

@meyerlor
Copy link
Copy Markdown
Collaborator Author

meyerlor commented May 17, 2026

hi @meyerlor

Now it is "Live" and that is exactly the scope of this PR.

sorry for the noise, but my new tests show this:

Are you sure you already have your PR running on your server? ;-)

Ah, well spotted - the filter stays active ( no change on the map visible when changeing back to the first filtered layer), but the number is getting reset to total features, not filtered features! :) - fixed & live (for now)

@josemvm
Copy link
Copy Markdown
Collaborator

josemvm commented May 17, 2026

@meyerlor Brilliant!

@josemvm
Copy link
Copy Markdown
Collaborator

josemvm commented May 17, 2026

one last thought... 🚀

imagem

or inside layer (i)nformation

@meyerlor
Copy link
Copy Markdown
Collaborator Author

that's where i'm at currently - but will be different branch / PR (so don't get confused about what is working on my testserver and what is not, working there quite a bit 😄 )

@meyerlor meyerlor changed the title fix(filter): keep other layers' filters when switching Fix/Keep other layers' filters when switching May 17, 2026
@rldhont
Copy link
Copy Markdown
Collaborator

rldhont commented May 17, 2026

@meyerlor the bug concerns 3.9. This fix should be available in version 3.9, right ?

@meyerlor meyerlor force-pushed the fix/6772-keep-other-layer-filters branch from 5d02444 to 0b3e5d7 Compare May 17, 2026 18:38
@meyerlor
Copy link
Copy Markdown
Collaborator Author

moved to 3.9!

@rldhont
Copy link
Copy Markdown
Collaborator

rldhont commented May 20, 2026

Linked to #6846 needs to be discussed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Enabling a form filter should NOT clear/reset other form filters already on other layers

3 participants