Bug 9728: XISBN use bibliographic search instead of SQL to fetch related bibs
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Thu, 28 Feb 2013 11:36:24 +0000 (12:36 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 17 Jun 2013 20:39:16 +0000 (13:39 -0700)
commitdd7fbbd70d5004c7fcf3b9d6a1b26c73d3fcebaa
tree319970ef31aeeb236f9a37ae2252fc4ae4d60c18
parent85d1e35b6c377618882a985662dcc7fb7e7aba48
Bug 9728: XISBN use bibliographic search instead of SQL to fetch related bibs

XISBN API uses normalized ISBN of a biblio to get a list of ISBNs
of related editions, then searched via SQL in database for biblios
with those ISBNs.

I noticed that if input ISBN has hyphens, the ISBNs returned by the
OCLC XISBN service also have hyphens; otherwise, if the input ISBN
doesn't have hyphens, the returned ISBNs don't either.

Consequently, an SQL query on biblioitems.isbn may not turn up
the right biblios.

Also, if biblio has several ISBNs, only first one can be found with
the original SQL query (isbn LIKE '$xisbn%').

This patch replaces SQL query by a simple search "nb=$xisbn". This will
find biblio from ISBN with or without hyphen.

Test plan :
- Activate FRBRizeEditions and XISBN sysprefs
- Go to a biblio witch has several editions
- Note its normalized ISBN (you may look in amazon links)
- Replace [ISBN] by biblio normalized ISBN in this URL : http://xisbn.worldcat.org/webservices/xid/isbn/[ISBN]?method=getEditions&format=xml&fl=form,year,lang,ed
- Go to this URL and see which ISBNs are returned
- Perform a simple search on thoses ISBNs : nb:1234567890
- Look at "Editions" tab
=> Check that diplayed biblios are the same you found by simple search

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/XISBN.pm