Bug 24243: Do not explode if invalid metadata when searching catalogue
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sun, 15 Dec 2019 11:53:06 +0000 (12:53 +0100)
committerJoy Nelson <joy@bywatersolutions.com>
Mon, 23 Dec 2019 15:36:39 +0000 (15:36 +0000)
commitbec6babff62908fe73cb33e825fac63b25c1468e
tree73c4eced262fb9722de6d30d6316d4d0ca8b73e2
parent1aa943d9af93f8c6ffd8cc1c962c10862a46606b
Bug 24243: Do not explode if invalid metadata when searching catalogue

If the bibliographic record metadata cannot be decoded, the get_coins
call should catch the exception raised by Koha::Biblio::Metadata->record
to not explode

Error is: "Invalid data, cannot decode objec"

Test plan:
0/ Do not apply the patch
1/ Search for record at the OPAC
2/ Note one of the biblionumber from the first page result
3/ Set to empty string the biblio_metadata to make the error appears:
  update biblio_metadata set metadata="" where biblionumber=42;
4/ Try the same search
=> You get an internal server error
5/ Apply the patch, restart plack and try again
=> It now works, ie. it does not explode

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
opac/opac-search.pl