Adding 'labels != <anything>' filter filters out all issues without a label set #247

Closed
opened 2026-02-27 14:57:30 -05:00 by deekerman · 12 comments
Owner

Originally created by @bayger on GitHub (Jul 9, 2024).

Description

If you try to add any filter to NOT show issues with a particular label it also filters out all issues that have no label set. Expected behavior would be to show also issues without any label set and only filter out issues with specified label in the filter.

How to reproduce on the demo site:

  • go to Inbox project
  • edit List view and add '&& labels != Personal' to the filter
  • all issues without label set will disappear

Vikunja Version

0.24

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

Originally created by @bayger on GitHub (Jul 9, 2024). ### Description If you try to add any filter to NOT show issues with a particular label it also filters out all issues that have no label set. Expected behavior would be to show also issues without any label set and only filter out issues with specified label in the filter. How to reproduce on the demo site: - go to Inbox project - edit List view and add '&& labels != Personal' to the filter - all issues without label set will disappear ### Vikunja Version 0.24 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
deekerman 2026-02-27 14:57:30 -05:00
Author
Owner

@kolaente commented on GitHub (Jul 10, 2024):

Does it work if you check the checkbox below the filter input which says 'include tasks which don't have a value set'?

@kolaente commented on GitHub (Jul 10, 2024): Does it work if you check the checkbox below the filter input which says 'include tasks which don't have a value set'?
Author
Owner

@bayger commented on GitHub (Jul 10, 2024):

Does it work if you check the checkbox below the filter input which says 'include tasks which don't have a value set'?

I don't have such checkbox available. Is it something new? My version is 0.24.0.
image

@bayger commented on GitHub (Jul 10, 2024): > Does it work if you check the checkbox below the filter input which says 'include tasks which don't have a value set'? I don't have such checkbox available. Is it something new? My version is 0.24.0. ![image](https://github.com/go-vikunja/vikunja/assets/2379135/f5c9cd4d-0982-4ae7-b487-4cb33ae07023)
Author
Owner

@kolaente commented on GitHub (Jul 10, 2024):

Ah, I thought you were using the filter in the view. I think to solve this properly, we'll need to implement null filtering as requested here and get rid of the checkbox: https://community.vikunja.io/t/filtering-search-for-null/2572/3

@kolaente commented on GitHub (Jul 10, 2024): Ah, I thought you were using the filter in the view. I think to solve this properly, we'll need to implement null filtering as requested here and get rid of the checkbox: https://community.vikunja.io/t/filtering-search-for-null/2572/3
Author
Owner

@bayger commented on GitHub (Jul 10, 2024):

Now I wonder if we could simply return TRUE for the inequality operator applied to an empty/null entity? Or would it screw up something elsewhere? Not sure about the expected behavior there though.

@bayger commented on GitHub (Jul 10, 2024): Now I wonder if we could simply return TRUE for the inequality operator applied to an empty/null entity? Or would it screw up something elsewhere? Not sure about the expected behavior there though.
Author
Owner

@kolaente commented on GitHub (Jul 10, 2024):

It's not as simple as that, because the query is translated to a sql query under the hood.

@kolaente commented on GitHub (Jul 10, 2024): It's not as simple as that, because the query is translated to a sql query under the hood.
Author
Owner

@horusofoz commented on GitHub (Dec 31, 2024):

Would the proposed null filter also allow for filtering tasks where startDate is not set?

@horusofoz commented on GitHub (Dec 31, 2024): Would the proposed null filter also allow for filtering tasks where startDate is not set?
Author
Owner

@nosbig commented on GitHub (Jan 10, 2025):

I would love to have null filtering/searching as well, as I'd like to build a filter to find all tasks with no labels so that I can work a backlog queue and assign labels for any tasks missing my desired label structure.

@nosbig commented on GitHub (Jan 10, 2025): I would love to have null filtering/searching as well, as I'd like to build a filter to find all tasks with no labels so that I can work a backlog queue and assign labels for any tasks missing my desired label structure.
Author
Owner

@0KayKay commented on GitHub (Mar 31, 2025):

I'd also love to use that null filter. All is fine when the tasks are filled out completely, but at some point I make a mistake when I create one and lose it. It would be very convenient to explicitly search for those tasks and filter out everything else.

@0KayKay commented on GitHub (Mar 31, 2025): I'd also love to use that null filter. All is fine when the tasks are filled out completely, but at some point I make a mistake when I create one and lose it. It would be very convenient to explicitly search for those tasks and filter out everything else.
Author
Owner

@vovochka404 commented on GitHub (Apr 4, 2025):

@kolaente will u be interested in PR with such filter conditions implemented? And if so, do you have any thoughts on it? Or i can try to implement it and then we will discuss it in PR?

P.S. Thank you for your job :)

@vovochka404 commented on GitHub (Apr 4, 2025): @kolaente will u be interested in PR with such filter conditions implemented? And if so, do you have any thoughts on it? Or i can try to implement it and then we will discuss it in PR? P.S. Thank you for your job :)
Author
Owner

@CoffeePerry commented on GitHub (Apr 4, 2025):

The following filter also does not work properly:

assignees != simoneperini

Even though it is flagged "include tasks which don't have a value set".
Tasks that do not have an assignee set do not appear.

@CoffeePerry commented on GitHub (Apr 4, 2025): The following filter also does not work properly: ``` assignees != simoneperini ``` Even though it is flagged "_include tasks which don't have a value set_". Tasks that do not have an assignee set do not appear.
Author
Owner

@kolaente commented on GitHub (Apr 9, 2025):

@vovochka404 I'd happily take a PR implementing null as a keyword for filters!

The most straight-forward way to implement this would be by just translating the null to a null in the database. Related entities (like reminders or labels) would need a little more work, though.

@kolaente commented on GitHub (Apr 9, 2025): @vovochka404 I'd happily take a PR implementing null as a keyword for filters! The most straight-forward way to implement this would be by just translating the null to a `null` in the database. Related entities (like reminders or labels) would need a little more work, though.
Author
Owner

@vovochka404 commented on GitHub (Apr 15, 2025):

Currently i'm having troubles with typesence, cause it doesn't support any checks against null/existence.

As i can see, you also skipped filterIncludeNulls flag when working with typesence. What are your thoughts about this inconsistency?

@vovochka404 commented on GitHub (Apr 15, 2025): Currently i'm having troubles with typesence, cause it doesn't support any checks against null/existence. As i can see, you also skipped `filterIncludeNulls` flag when working with typesence. What are your thoughts about this inconsistency?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vikunja-go-vikunja#247
No description provided.