[Bug 35578] New: Validate "Where" in OPAC Authority search
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 Bug ID: 35578 Summary: Validate "Where" in OPAC Authority search Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org At the moment, the "marclist" parameter - used in the "Where" field for the OPAC Authority search - isn't being properly validated. This can lead to syntactically incorrect queries which cause server errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- To reproduce: 1. Go to /cgi-bin/koha/opac-authorities-home.pl 2. Type "test" into "Term(s)" field 3. Modify the selected option for the "marclist" parameter for "Where" field to say "this is broken" 4. Click "Submit" 5. Note that a server error is generated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35566 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 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=35578 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 159856 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159856&action=edit Bug 35578: Validate "Where" in OPAC Authority search This patch adds validation to the "Where" field in OPAC Authority search. Test plan: 0. Apply the patch and koha-plack --reload kohadev 1. Go to http://localhost:8080/cgi-bin/koha/opac-authorities-home.pl 2. Type "test" into "Term(s)" field 3. Click "Submit" 4. Confirm a result is found 5. Repeat the above using "Where" values of "in the complete record", "in any heading", and "in main entry" 6. Using the HTML inspector in the browser, change the value of the selected option of the "marclist" select element to "this is broken" 7. Click "Submit" 8. Confirm a result is found (ie it's not throwing a fatal error anymore) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |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=35578 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159856|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 159926 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159926&action=edit Bug 35578: Validate "Where" in OPAC Authority search This patch adds validation to the "Where" field in OPAC Authority search. Test plan: 0. Apply the patch and koha-plack --reload kohadev 1. Go to http://localhost:8080/cgi-bin/koha/opac-authorities-home.pl 2. Type "test" into "Term(s)" field 3. Click "Submit" 4. Confirm a result is found 5. Repeat the above using "Where" values of "in the complete record", "in any heading", and "in main entry" 6. Using the HTML inspector in the browser, change the value of the selected option of the "marclist" select element to "this is broken" 7. Click "Submit" 8. Confirm a result is found (ie it's not throwing a fatal error anymore) Signed-off-by: David Nind <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=35578 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- Why do we call multi_param for marclist ? Is there any case where it makes sense to have multiple values ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Julian Maurice from comment #4)
Why do we call multi_param for marclist ? Is there any case where it makes sense to have multiple values ?
I've looked at ./koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt and opac/opac-authorities-home.pl. At a glance, it's not clear why these are array variables. I've done a bit of "git blame" and basically it looks like really old legacy code that basically never made sense. I think it's out of scope for this bug, but this could certainly be refactored. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159926|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 160984 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160984&action=edit Bug 35578: Validate "Where" in OPAC Authority search This patch adds validation to the "Where" field in OPAC Authority search. Test plan: 0. Apply the patch and koha-plack --reload kohadev 1. Go to http://localhost:8080/cgi-bin/koha/opac-authorities-home.pl 2. Type "test" into "Term(s)" field 3. Click "Submit" 4. Confirm a result is found 5. Repeat the above using "Where" values of "in the complete record", "in any heading", and "in main entry" 6. Using the HTML inspector in the browser, change the value of the selected option of the "marclist" select element to "this is broken" 7. Click "Submit" 8. Confirm a result is found (ie it's not throwing a fatal error anymore) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 160985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160985&action=edit Bug 35578: Simplify the code using intersect Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160984|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 161235 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161235&action=edit Bug 35578: Validate "Where" in OPAC Authority search This patch adds validation to the "Where" field in OPAC Authority search. Test plan: 0. Apply the patch and koha-plack --reload kohadev 1. Go to http://localhost:8080/cgi-bin/koha/opac-authorities-home.pl 2. Type "test" into "Term(s)" field 3. Click "Submit" 4. Confirm a result is found 5. Repeat the above using "Where" values of "in the complete record", "in any heading", and "in main entry" 6. Using the HTML inspector in the browser, change the value of the selected option of the "marclist" select element to "this is broken" 7. Click "Submit" 8. Confirm a result is found (ie it's not throwing a fatal error anymore) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=35578 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160985|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 161236 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161236&action=edit Bug 35578: Simplify the code using intersect Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=35578 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Trivial fix, agree the refactoring/cleanup can go on another bug. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |24.05.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=35578 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00 |24.05.00,23.11.03 released in| | Patch complexity|--- |Small patch CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35578 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=35578 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Resolution|--- |FIXED Status|Pushed to stable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org