[Bug 41726] New: Item search: "Is not" is missing all items where location/collection is empty
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 Bug ID: 41726 Summary: Item search: "Is not" is missing all items where location/collection is empty Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl When adding a new item to Koha and not setting a location or collection, they are set to NULL in the database. This leads to problems with "is not" searches in the item search. Items with no collection or location are excluded/missing from search results. To test: * Create a new location by adding a new entry to the LOC authorised value category (so it's not used otherwise) * Add 2 items to a record Item A: has the location with the new value Item B: has no location Note the title of your record * Search using the item search: Title: your title (don't forget to truncate with %) Verify your 2 items are found * Amend the search and add to the search criteria: Location is not <your new location> * 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; -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #1 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (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. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- 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. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 Anneli Österman <anneli.osterman@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anneli.osterman@koha-suomi. | |fi --- Comment #6 from Anneli Österman <anneli.osterman@koha-suomi.fi> --- Is this dublicate of this bug https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37889? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41726 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|NEW |RESOLVED --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (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 *** -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org