[Bug 30865] New: Koha::Biblio->get_components_query should double quote Host-item search
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Bug ID: 30865 Summary: Koha::Biblio->get_components_query should double quote Host-item search Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org As noted at https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11175#c522 and https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29418#c11, an unquoted Host-item query returned by Koha::Biblio->get_components_query can cause syntax errors in Zebra. -- 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=30865 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29418 Depends on| |11175 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11175 [Bug 11175] Show the parent record's component parts in the detailed views -- 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=30865 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |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=30865 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Reference on Elasticsearch syntax: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-qu... Reference on CCL/Zebra syntax: https://software.indexdata.com/yaz/doc/tools.html#ccl.syntax The CCL documentation isn't great and Koha has never handled CCL very well... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 135445 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135445&action=edit Bug 30865: Double-quote Host-item in Koha::Biblio->get_components_query This patch adds double quotes around the term qualified by "Host-item" in Koha::Biblio->get_components_query(). Without them, reserved charactrs like "=" will cause syntax errors like "CCL parsing error (10014) Unknown qualifier ZOOM for query: Host-item=(MyTitle = Mysubtitle) at /usr/share/koha/lib/C4/Search.pm line 245." Test plan: 0) Don't apply the patch 1) Create biblio with title and subtitle like (MyTitle : MySubtitle) 2) Note the warning "There was an error searching for analytic records, please see the logs for details." on the detail page 3) Apply the patch 4) koha-plack --restart kohadev 5) Refresh the detail page 6) Note that the warning message is gone 7) prove t/db_dependent/Koha/Biblio.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30866 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135445|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 136669 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136669&action=edit Bug 30865: Double-quote Host-item in Koha::Biblio->get_components_query This patch adds double quotes around the term qualified by "Host-item" in Koha::Biblio->get_components_query(). Without them, reserved charactrs like "=" will cause syntax errors like "CCL parsing error (10014) Unknown qualifier ZOOM for query: Host-item=(MyTitle = Mysubtitle) at /usr/share/koha/lib/C4/Search.pm line 245." Test plan: 0) Don't apply the patch 1) Create biblio with title and subtitle like (MyTitle : MySubtitle) 2) Note the warning "There was an error searching for analytic records, please see the logs for details." on the detail page 3) Apply the patch 4) koha-plack --restart kohadev 5) Refresh the detail page 6) Note that the warning message is gone 7) prove t/db_dependent/Koha/Biblio.t 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=30865 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |martin.renvoize@ptfs-europe | |.com --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for working on this David, my apologies for not getting to testing it as quickly as I should. This works great, a much cleaner solution too. Tested with Zebra and Elastic and as the docs say it works well for both. In the end, this is a trivial patch so I'm going straight for QA. QA script happy, Unit tests passing, No regressions and bug is fixed. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.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=30865 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31106 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31106 [Bug 31106] Error searching for analytics in detail view -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Martin Renvoize from comment #4)
Thanks for working on this David, my apologies for not getting to testing it as quickly as I should.
This works great, a much cleaner solution too.
Tested with Zebra and Elastic and as the docs say it works well for both.
In the end, this is a trivial patch so I'm going straight for QA.
QA script happy, Unit tests passing, No regressions and bug is fixed.
Passing QA
Please look at bug 31106 ASAP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|22.11.00 |22.11.00, 22.05.04 released in| | CC| |lucas@bywatersolutions.com --- Comment #7 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |arthur.suzuki@biblibre.com Version(s)|22.11.00, 22.05.04 |22.11.00, 22.05.04, released in| |21.11.11 --- Comment #8 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- backport to 21.11.x for 21.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30865 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED --- Comment #9 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org