bug 2254 [1/3]: fixed GetAuthType(); avoid crash
authorGalen Charlton <galen.charlton@liblime.com>
Wed, 25 Jun 2008 16:30:01 +0000 (11:30 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 25 Jun 2008 16:39:24 +0000 (11:39 -0500)
commit98f638bb14d0a5763e45ee32c5bc07756324c6e1
tree6993ceb277fa8ce2ce57e31bbc43dfdcbae9037d
parent8894d28779b723410aeac3e947c7f5ebb814eb60
bug 2254 [1/3]: fixed GetAuthType(); avoid crash

Improved C4::AuthoritiesMarc::GetAuthType() so that
it returns either a hashref (if the authority type exists)
or undef (if it does not exist).  The same
accessor should not be used to either return a single
value or all values of a settings list.  Note that
all existing clients of GetAuthType are expecting
either a single hashref or undef; none of them
expected the arrayref that could be returned by
the previous version of the accessor.

When BiblioAddsAuthorities is ON, addbiblio.pl
now checks the return value of GetAuthType and
no longer crashes as follows if the MARC framework
specifies an invalid authority type for a given subfield:

Can't coerce array into hash at .../cataloging/addbiblio.pl line 738.

No documentation changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/AuthoritiesMarc.pm
cataloguing/addbiblio.pl