[Bug 14627] New: GetAuthorisedValueByCode does not handle undef intelligently
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Bug ID: 14627 Summary: GetAuthorisedValueByCode does not handle undef intelligently Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: colin.campbell@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org GetAuthorisedValueByCode is used in many places throughout Koha, many of the fields being looked up are nullable but if passed undef the routine proceeds to prepare and execute a meaningless query it should check the passed value and proceed with random behaviour -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Severity|enhancement |trivial --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Trivial patch - improves code flow saving unnecessary processing -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |colin.campbell@ptfs-europe. | |com Status|NEW |Needs Signoff CC| |colin.campbell@ptfs-europe. | |com --- Comment #2 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 41266 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41266&action=edit Proposed patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Colin, your patch makes sense. But what do u think of focusing on bug 10363? It has lagged a bit. Maybe another couple of eyes can make it move faster. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41266|0 |1 is obsolete| | --- Comment #4 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 43090 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43090&action=edit Bug 14627 Check for undef passed to GetAuthorisedValueByCode Dont prepare or execute unnecessary sql if passed an undef value routine is used in various places that dont check if the value returned from a nullable field is defined or not (e.g. streettype in the borrower record which many sites do not use) Lets save those cpu cycles for something useful -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 43091 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43091&action=edit Bug 14627: Improve SQL query A field=NULL condition does not run properly. If category is undefined, then don't include it in the query. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Just wanted to put my work here, before I blew it away. :) I figure bug 10363 as mentioned by Tomas will probably make this obsoleted and not required. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10363 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43090|0 |1 is obsolete| | --- Comment #7 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 44263 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44263&action=edit [SIGNED-OFF] Bug 14627: Check for undef passed to GetAuthorisedValueByCode Dont prepare or execute unnecessary sql if passed an undef value routine is used in various places that dont check if the value returned from a nullable field is defined or not (e.g. streettype in the borrower record which many sites do not use) Lets save those cpu cycles for something useful Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43091|0 |1 is obsolete| | --- Comment #8 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 44264 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44264&action=edit [SIGNED-OFF] Bug 14627: Improve SQL query A field=NULL condition does not run properly. If category is undefined, then don't include it in the query. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No regressions detected, no errors -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14627 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |katrin.fischer@bsz-bw.de --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Can we please get unit tests and a test plan for this? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org