Force Amazon AC requests to use 10-digit ISBNs
authorDan Scott <dscott@laurentian.ca>
Tue, 1 Nov 2011 17:29:25 +0000 (13:29 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 1 Nov 2011 17:57:49 +0000 (13:57 -0400)
commit91441797b5f91816270730d1f604d6b23a7ef768
tree900b6bd48b0ab0104b9148c541dd94a1d0d0d4d0
parent3eabec82e376dab913991c421988543bf97dc5be
Force Amazon AC requests to use 10-digit ISBNs

Inspired by a patch submitted by Ian Bays <ian.bays@ptfs-europe.com>
via https://bugs.launchpad.net/evergreen/+bug/870171, this patch takes
the incoming key and, if it is longer than 10 characters (a 10-digit
ISBN or Amazon ID), attempts to normalize it and return a 10-digit ISBN.

We don't normalize all incoming keys because some sites are horribly
abusing the 020 MARC field to include an Amazon ID instead of an ISBN -
but that works in practice and we'd rather not break working
installations if we can avoid it.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Amazon.pm