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
Trivial patch - improves code flow saving unnecessary processing
Created attachment 41266 [details] [review] Proposed patch
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.
Created attachment 43090 [details] [review] 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
Created attachment 43091 [details] [review] 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.
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.
Created attachment 44263 [details] [review] [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>
Created attachment 44264 [details] [review] [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
Can we please get unit tests and a test plan for this?
This subroutine is going to be removed by bug 17252