Best hold selection: fix a checkin-busting bug affecting Holds-go-home
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 19 Mar 2013 20:13:35 +0000 (16:13 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 2 Apr 2013 01:27:40 +0000 (21:27 -0400)
commitba5cb36e165c8274a8a1ed5ad74bd16cf44936e0
tree36f547f6c0334bf7d94dd5196cd3ddf42c9863f8
parent5a1ef757c880e931e88cf09c1c6e1234a524206e
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>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm