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)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 23 Dec 2019 11:05:03 +0000 (11:05 +0000)
commit8112e2a6361af871cada25c328ab9c04c0796fb7
tree03fc4d8d7cdeb3b1597d0a96399f127e3001e6b7
parent3c222cf569c3b7d236c93df92696548a8bb8e1c5
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>
opac/opac-search.pl