Avoid JSPAC hold placement interface problems when no holdable copies user/senator/jspac-holds-empty-descriptor-list
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 24 Feb 2012 19:56:18 +0000 (14:56 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 28 Feb 2012 20:37:57 +0000 (15:37 -0500)
commitbb9094be0421159d4728d14a20ae0af33a545036
tree7f0d73fc11ab6e475ad6f27b3def67cc83dc65ef
parent5b7b588c3e41b522f39c46deb2ba48cc92acf9ea
Avoid JSPAC hold placement interface problems when no holdable copies

This addresses a bug brought to my attention by John Jones.

When you're trying to place certain holds (at least title level holds) on
records for which there are no holdable formats (no descriptors as returned by
open-ils.search.metabib.record_to_descriptors), then
holdArgs.recordDescriptors in holds.js can be an empty array.  There is
a line of code that assumes this will never happen.

The end user-visible result of the javascript failing here is an alert()
dialog about phone number format, but this is a red herring.  That only
happens because the problem code is in one big function that has too
many responsibilites.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/web/opac/skin/default/js/holds.js