[Bug 36930] New: Item search gives irrelevant results when using 2+ added filter criteria
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Bug ID: 36930 Summary: Item search gives irrelevant results when using 2+ added filter criteria Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: januszop@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com In the Item search a librarian is allowed, in the first step, to define additional filters like Title, Author, Publisher, Publication date etc. (the third fieldset). This works fine but only for one criterion. If one adds two or more criteria, the filter does not apply at all. -- 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=36930 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- 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=36930 --- Comment #1 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 167052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167052&action=edit Bug 36930: Item search gives irrelevant results when using 2+ added filter criteria In the Item search the librarian is allowed, in the first step, to define additional filters like Title, Author, Publisher, Publication date etc. (in the third fieldset). This works fine but only for one criterion. If one adds two or more criteria, the filter does not apply at all. Test plan ========= 1. Make an Item search with the Pulblisher filter. Put %University of California% as the value. You should get 5 rows (with standard ktd test data set), three from 1982, and two from 1988. 2. Edit search -> add the second criterion: AND Publication date is 1982. You would expect three rows but you get 900+ rows. 3. Apply the patch; restart_all. 4. Repeat p. 2. You should get the expected three rows. -- 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=36930 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial --- Comment #2 from Janusz Kaczmarek <januszop@gmail.com> --- BTW, I have no idea why the CGI parameters change their names from q into q[], f into f[], etc., depending on the number of the rows in the form--but they do. Certainly there is an explanation--any hint would be appreciated. -- 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=36930 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |januszop@gmail.com |ity.org | -- 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=36930 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This is needed in addition to bug 36563? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 --- Comment #4 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Katrin Fischer from comment #3)
This is needed in addition to bug 36563?
Oh, that's strange indeed. The bug description seems similar. To be sincere, I didn't see it prior to submitting my patch, but I worked on fresh main of yesterday. So, it seems to be still a problem. The bug 36563 would work only for the two first fieldsetd, if I guess right. And the mine--for the third. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz, | |jonathan.druart@gmail.com, | |lucas@bywatersolutions.com, | |michaela.sieber@kit.edu Depends on| |36563 --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Hey, I intend to take a look here when possible but adding other possibly interested parties to the mix in the meantime. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36563 [Bug 36563] Item search does not search for multiple values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 --- Comment #6 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Janusz Kaczmarek from comment #2)
Certainly there is an explanation--any hint would be appreciated.
This patch (I believe a follow-up to the datatables upgrade from 1.10.18 to 1.13.6): https://github.com/Koha-Community/Koha/commit/63183059dd975c2f5265fa4c7d2bc5... (link goes directly to the line we're addressing here) This changed the payload data from an array of JSON objects to a single JSON object. This caused a problem, because a JSON object can only have one instance of a property and this scenario was not considered for more than 1 arg for the same filter. Using Janusz's use-case, this is what the request payload looked like: [ ..., {name: 'f', value: 'publishercode'}, {name: 'op', value: 'like'}, {name: 'q', value: '%University of California%'}, {name: 'c', value: 'and'}, {name: 'f', value: 'publicationyear'}, {name: 'op', value: 'like'}, {name: 'q', value: '1988'}, ... ] But after that patch, this is what we had (same use-case - notice the absence of the first query parameters set): { ... c: 'and', f: 'publicationyear', op: 'like', q: '1988', ... } This is because the following line: d[params[i].name] = params[i].value; Was effectivelly doing: d['f'] = 'publishercode'; d['f'] = 'publicationyear'; The end result is you only get the last property value in the final object. You can test this yourself: Rest your branch to the commit directly before the datatables upgrade: git reset --hard b54da05c73c9ea5b04d3552b34fcc636b0a71851 reset_all And console.log(aoData) in itemsearch.tt Then, reset your branch to the commit directly before bug 36563: git reset --hard 903a8685c661ddde61335a08e126506120345abc reset_all And console.log(d) after the for loop -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167052|0 |1 is obsolete| | --- Comment #7 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 167169 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167169&action=edit Bug 36930: Item search gives irrelevant results when using 2+ added filter criteria In the Item search the librarian is allowed, in the first step, to define additional filters like Title, Author, Publisher, Publication date etc. (in the third fieldset). This works fine but only for one criterion. If one adds two or more criteria, the filter does not apply at all. Test plan ========= 1. Make an Item search with the Pulblisher filter. Put %University of California% as the value. You should get 5 rows (with standard ktd test data set), three from 1982, and two from 1988. 2. Edit search -> add the second criterion: AND Publication date is 1982. You would expect three rows but you get 900+ rows. 3. Apply the patch; restart_all. 4. Repeat p. 2. You should get the expected three rows. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 --- Comment #8 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- I think the patch is good, it's basically a follow-up of bug 36563 as it's addressing use cases we missed (i.e. forgot to test) at the time. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Paulina <pmis@mnw.art.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pmis@mnw.art.pl --- Comment #9 from Paulina <pmis@mnw.art.pl> --- Works fine, even with +3 filter criteria (one with MARC field 260$a) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167169|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 167340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167340&action=edit Bug 36930: Item search gives irrelevant results when using 2+ added filter criteria In the Item search the librarian is allowed, in the first step, to define additional filters like Title, Author, Publisher, Publication date etc. (in the third fieldset). This works fine but only for one criterion. If one adds two or more criteria, the filter does not apply at all. Test plan ========= 1. Make an Item search with the Pulblisher filter. Put %University of California% as the value. You should get 5 rows (with standard ktd test data set), three from 1982, and two from 1988. 2. Edit search -> add the second criterion: AND Publication date is 1982. You would expect three rows but you get 900+ rows. 3. Apply the patch; restart_all. 4. Repeat p. 2. You should get the expected three rows. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for the fix here Janusz, and the clear reasoning and testing Pedro. All looking solid to me, Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00 |24.11.00,24.05.02 released in| | Status|Pushed to main |Pushed to stable --- Comment #13 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|24.11.00,24.05.02 |24.11.00,24.05.02,23.11.07 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.07 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the item search release notes| |so that it returns the | |correct results when two or | |more additional filters are | |used (such as publisher and | |publication date). It was | |working correctly with one | |filter, but was not using | |any filters if two or more | |were used in a query. CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldstable |Pushed to oldoldstable Version(s)|24.11.00,24.05.02,23.11.07 |24.11.00,24.05.02,23.11.07, released in| |23.05.15 --- Comment #15 from wainuiwitikapark@catalyst.net.nz --- Backported to 23.05.x for 23.05.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36930 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldoldstable |RESOLVED --- Comment #16 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org