Bug 11032: Check a valid MARC::Record passed to Biblio
authorColin Campbell <colin.campbell@ptfs-europe.com>
Thu, 10 Oct 2013 17:06:14 +0000 (18:06 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 10 Dec 2013 05:01:54 +0000 (05:01 +0000)
commit2e0e15485ecae556b77037443af1077291fe3673
tree7879062f29aa94c809d266e34214b2c7e249a570
parent62fcbea10a0e7b3fbca74531ec5051704ab63f7c
Bug 11032: Check a valid MARC::Record passed to Biblio

Intermittently problems in the calling environment
cause a C4::Biblio routine to be called with an undefined
MARC::Record object. This results in the process
dying and returning to the end user a low level
message such as 'cannot call method x on an undefined
object'.

For exported subroutines taking a MARC::Record object,
check that object is defined otherwise return a logical
return value and log a stack trace to the error log.
A couple of cases were checking but dying, this may have
unwelcome results in a persistent environment so croak has
been downgraded to carp

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds lots of checks for $record in various places, should
not affect behaviour.
Passed all tests and QA script, including new unit tests.
Tested adding and saving a new record.
Also tested detail and result pages without XSLT.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Biblio.pm
t/Biblio.t [new file with mode: 0755]