http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5415 Summary: Simplify Returns from SimpleSearch Change sponsored?: --- Product: Koha Version: HEAD Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P5 Component: Searching AssignedTo: gmcharlt@gmail.com ReportedBy: colin.campbell@ptfs-europe.com QAContact: koha-bugs@lists.koha-community.org Estimated Hours: 0.0 SimpleSearch routine returns an array of three values an errorstring, a reference to an array of records and a scalar number of hits. If an error is returned the array_ref and hit_count are undefined If there is no error returned the errorstring is undefined. but the other elements maybe defined or undefined. As a result it exports complexity into the calling interface which typically has to test is there an error then for each return element test definedness then assign it etc. leading to code hard to read, maintain and sometimes get right. People do seem to have a problems resulting from the implied "randomness" of the return. Proposal that the variables used in non-error returns are initialized so that they are only undefined in in error returns. Current code should still work as is (otherwise its a bit buggy already!) Will mean that only error needs checking if not defined hit_count is a scalar >= 0 and array_ref is a ref to a (possibly empty) array. Calls to SimpleSearch can then simplified accordingly -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug.