| Summary: | Item search: "Is not" is missing all items where location/collection is empty | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
| Component: | Cataloging | Assignee: | Bugs List <koha-bugs> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | andrew, anneli.osterman, m.de.rooy |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
|
Description
Katrin Fischer
2026-01-28 16:07:58 UTC
(In reply to Katrin Fischer from comment #0) > * Verify that you get NO results. > Expected behavior: The item with no location should be found > > In SQL we can see the difference: > select * from items where location != "something"; > > Results including NULL/empty locations: > select * from items where location != "something" OR location is NULL; I guess I'd counter that the expected behavior in item search is that it behave the way a SQL query does, since item search is a GUI for SQL. That means "where location != 'something'" really means "where location has a value that is not 'something.'" But I do see the utility in allowing item search to optionally include NULLs on an "is not" search. Maybe it could be an option/checkbox? One problem is that we currently can't use the item search to find the entries where the value is not set, which could be useful in a lot of cases. (In reply to Katrin Fischer from comment #2) > Maybe it could be an option/checkbox? > One problem is that we currently can't use the item search to find the > entries where the value is not set, which could be useful in a lot of cases. A checkbox for "include NULL values in 'is not' searches" makes sense to me, for sure. I'd just hate to hardcode something that makes item search silently diverge from standard SQL. I am not sure I understand the argument about the SQL standard, because I believe that Koha is not very good about "" vs. NULL and that the normal user doesn't understand that difference. I could also totally imagine that our old data is not super clean in that regard and some libraries have a mix of both options. But I am happy to discuss how we can solve this best! Note: when "" is in location, the search works as expected, it's only the NULL that creates a different result. Currently, we can confidently assert that item search behaves the same as SQL. For all of SQL's quirks and pitfalls, it is well documented and broadly used. If we start adjusting how item search queries are interpreted, then we move to "item search _mostly_ behaves the same as SQL" and it's our responsibility to document and remember the points of divergence. Is this dublicate of this bug https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37889? (In reply to Anneli Österman from comment #6) > Is this dublicate of this bug > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37889? Thanks Anneli, I missed this one. *** This bug has been marked as a duplicate of bug 37889 *** |