Best hold selection: fix a checkin-busting bug affecting Holds-go-home user/senator/best-hold-sql-error
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 19 Mar 2013 20:13:35 +0000 (16:13 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 19 Mar 2013 20:15:08 +0000 (16:15 -0400)
commit11e1274bfc9f8afef6873794014df900d34d0489
tree29b5f5994b9e9db25c89618581562f9a539ea808
parent306e47e4d1a55dfaa8e45d97c9cf02b8ae30f69a
Best hold selection: fix a checkin-busting bug affecting Holds-go-home

Several subselects within SQL auxiliary queries can possibly return
multiple rows in situations where outer code requires that they return
only one or zero rows.

When you're using a best-hold order that includes htime or shtime, (such
as those with Holds-go-home) and if there are mutiple circs or transits
related to the copy in hand with certain characteristics, you can
trigger this bug.  The end user at the staff client gets one of those
nasty "Network error" dialogs, and the error in the SQL logs is:

> ERROR:  more than one row returned by a subquery used as an expression

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm