[Bug 34857] New: OPAC advanced search operator "not" is searching as "and" after completing an "and" search
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 Bug ID: 34857 Summary: OPAC advanced search operator "not" is searching as "and" after completing an "and" search Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Searching Assignee: koha-bugs@lists.koha-community.org Reporter: Laura.escamilla@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate in ktd or sandboxes: 1. In the Koha OPAC go to Advanced search and choose "More options". 2. Do a keyword search for "Doctor Who" with an operator of "Not" and a second keyword search of "video". Only 1 search result shows up. 3. Go back to the advanced search using the back arrow (don't click on Advanced search again). 4. Now search for "Doctor Who" with an operator of "And" and a second keyword search of "video". This shows 3 results. 5. Go back again to advanced search using the back arrow. 6. Try the "Not" video search again. The results show the 3 video results that appeared with the "And" operator. They do not show the 1 result that showed with the "Not" operator. -- 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=34857 holly@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |holly@bywatersolutions.com --- Comment #1 from holly@bywatersolutions.com --- ALL OPAC advanced search operators are functioning as AND. 1. Do a basic search with two KW terms using OR 2. Repeat the basic search using AND 2. Do an advanced search with same terms in 2 fields using OR Note advanced OR search gives same number of results as AND -- 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=34857 jesus@medios.es changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jesus@medios.es --- Comment #2 from jesus@medios.es --- The search query varies according to the browser used. For Chrome (anonymous) and Firefox the result URL is correct. For Chrome standard it is not: Started happening in 22.11, when this code in opac-advsearch.tt was introduced: window.addEventListener('pageshow', function( e ){ $('.form-control').prop('disabled' , false ); }); Result URL in Chrome https://catalog.bywatersolutions.com/cgi-bin/koha/opac-search.pl?advsearch=1&op=AND&idx=kw&q=keyword1&op=NOT&idx=kw&q=keyword2&do=Search&sort_by=relevance Result URL in Firefox and anonymous Chrome: https://catalog.bywatersolutions.com/cgi-bin/koha/opac-search.pl?advsearch=1&idx=kw&q=keyword1&op=NOT&idx=kw&q=keyword2&do=Search&sort_by=relevance -- 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=34857 jesus@medios.es changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|OPAC advanced search |OPAC advanced search |operator "not" is searching |operator "not" is searching |as "and" after completing |as "and" on chrome |an "and" search | -- 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=34857 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr Severity|trivial |critical --- Comment #3 from Frédéric Demians <frederic@tamil.fr> --- It's not good at all :-) -- 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=34857 --- Comment #4 from Frédéric Demians <frederic@tamil.fr> --- The culprit is bug 33233. It should be reverted or amended. -- 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=34857 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33233 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33233 [Bug 33233] OPAC advanced search inputs stay disabled when using browser's back button -- 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=34857 --- Comment #5 from jesus@medios.es --- No back browser button involved in my proof of concept. Our programmer suggests it is a race condition on two different javascript codes. -- 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=34857 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The change on bug 33233 was quite small, any idea on how we could fix? @@ -459,6 +459,9 @@ [% BLOCK jsinclude %] [% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %] <script> +window.addEventListener('pageshow', function( e ){ + $('.form-control').prop('disabled' , false ); +}); $(document).ready(function() { [% IF search_groups %] function branch_limit() { @@ -559,6 +562,5 @@ $(document).ready(function() { $(this).parent().parent().remove(); $('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide(); }); - </script> [% END %] -- 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=34857 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cbrannon@cdalibrary.org --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 35214 has been marked as a duplicate of this bug. *** -- 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=34857 --- Comment #8 from Christopher Brannon <cbrannon@cdalibrary.org> --- Just found this problem today. On advanced search, keyword OR keyword works fine. subject OR subject is run as subject AND subject (see the URL after running the search). I can manually replace the AND with OR in the url and press enter and the search is run as expected. Just can't do it with the dropdown on the previous page. -- 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=34857 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.jonsson@kreablo.se --- Comment #9 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- I happened to notice the following difference: Firefox:
$('.form-control').get(0).disabled <- true
Chrome:
$('.form-control').get(0).disabled <- false
If you run
$('.form-control').get(0).disabled = true
in the console in chrome the search will work. It looks like this is a hidden <select> which is used for copying the operator dropdown menu when adding additional search clauses. It should be disabled. The difference between browser is probably in execution order. So, a fix is to change the code from bug 33233 to: window.addEventListener('pageshow', function( e ){ $('.form-control:visible').prop('disabled' , false ); }); -- 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=34857 --- Comment #10 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 158598 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158598&action=edit Bug 34857 Do not enable hidden select element (regression from bug 33233). Test plan: Using Chrome as web browser: * Go to opac advanced search * Press "more options" * Search for two keywords using "and" operator (on ktd search for idea AND behind, which matches 1 result) * Search for two keywords using "or" operator (on ktd search for idea OR behind, which matches 4 results) * Search for two keywords using "not" operator (on ktd search for idea NOT behind, which matches 2 results) -- 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=34857 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=34857 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=34857 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158598|0 |1 is obsolete| | --- Comment #11 from David Nind <david@davidnind.com> --- Created attachment 158619 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158619&action=edit Bug 34857 Do not enable hidden select element (regression from bug 33233). Test plan: Using Chrome as web browser: * Go to opac advanced search * Press "more options" * Search for two keywords using "and" operator (on ktd search for idea AND behind, which matches 1 result) * Search for two keywords using "or" operator (on ktd search for idea OR behind, which matches 4 results) * Search for two keywords using "not" operator (on ktd search for idea NOT behind, which matches 2 results) Signed-off-by: David Nind <david@davidnind.com> -- 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=34857 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes a regression release notes| |(from bug 33233) when using | |a Chrome-based browser with | |AND, OR, and NOT in OPAC > | |Advanced search > More | |options. Using these | |operators with keywords | |should now work as | |expected. CC| |david@davidnind.com -- 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=34857 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- 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=34857 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |andreas.jonsson@kreablo.se |ity.org | -- 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=34857 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158619|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 158621 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158621&action=edit Bug 34857 Do not enable hidden select element (regression from bug 33233). Test plan: Using Chrome as web browser: * Go to opac advanced search * Press "more options" * Search for two keywords using "and" operator (on ktd search for idea AND behind, which matches 1 result) * Search for two keywords using "or" operator (on ktd search for idea OR behind, which matches 4 results) * Search for two keywords using "not" operator (on ktd search for idea NOT behind, which matches 2 results) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks a lot Andreas, I am really happy to see this one fixed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- QA: the commit title fails the qa script tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am sorry, I thought I had fixed that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 --- Comment #17 from Christopher Brannon <cbrannon@cdalibrary.org> --- The title of this bug is misleading. It is not limited to Chrome. I can reproduce in Firefox. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 --- Comment #18 from David Nind <david@davidnind.com> --- (In reply to Christopher Brannon from comment #17)
The title of this bug is misleading. It is not limited to Chrome. I can reproduce in Firefox.
I tested using Firefox Developer Edition (Firefox version 120.0b7) and Chromium (version 119.0.6045.105) (on Ubuntu 22.04) - I was not able to replicate the problem in Firefox. As far as I could see, it was specific to Chrome-based browsers. I'll have another go shortly and see if I can replicate the issue using Firefox. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|23.11.00 |23.11.00,23.05.06 released in| | --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.06 |23.11.00,23.05.06,22.11.12 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 --- Comment #20 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Nice work everyone! Pushed to 22.11.x for next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34857 --- Comment #21 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Pedro Amorim from comment #20)
Nice work everyone!
Pushed to 22.11.x for next release
Nice! Thank you! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org