Bug 17380: Add some checks around Authorities::Types->find
commitb4326600132bb3d87764687385cc13a19dd35c54
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 23 Feb 2017 09:02:57 +0000 (23 10:02 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 23 Oct 2017 13:56:39 +0000 (23 15:56 +0200)
tree01daa1ee72a2952aae0704edf43cba5348c2e093
parent6db90c0cb97a9d03669d97bbc7465a6a27ff16f0
Bug 17380: Add some checks around Authorities::Types->find

Resolves:
Use of uninitialized value $biblio_fields in scalar chop at authorities/detail.pl line 212.
Can't call method "authtypetext" on an undefined value at authorities/detail.pl line 216.
Can't call method "authtypecode" on an undefined value at authorities/detail.pl line 180.

NOTE: Some of these problems have actually been resolved now by bugs 18801
and 18811, but it is still better imo to have these checks.

Test plan:
[1] Verify unchanged behavior. Search for some authorities on authorities.pl
    and click on the details of a record.
[2] Open an authorities detail page and change the authid in the URL to a
    not existing number. Instead of an internal server error, you should see
    a message like "The authority record you requested does not exist".

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3e631f418a3fafa485b650f0975ee0d06e366884)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
authorities/authorities.pl
authorities/detail.pl