This patch fixes a regression introduced by
commit
7e70202d34d75f988fbaea9b911347417c203aac
Bug 15381: Remove GetAuthType and GetAuthTypeCode
This first version will reintroduce the same behavior as before bug
15381: the record will be displayed even if it's no in the DB
Test plan:
Search for authorities
delete one
The zebra's index is not updated yet and the results will contain the
record you have deleted.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
}
}
- my $thisauthtypecode = Koha::Authorities->find($authid)->authtypecode;
- my $thisauthtype = Koha::Authority::Types->find($thisauthtypecode);
+ my ( $thisauthtype, $thisauthtypecode );
+ if ( my $authority = Koha::Authorities->find($authid) ) {
+ $thisauthtypecode = $authority->authtypecode;
+ $thisauthtype = Koha::Authority::Types->find($thisauthtypecode);
+ }
unless (defined $thisauthtype) {
$thisauthtypecode = $authtypecode;
$thisauthtype = Koha::Authority::Types->find($thisauthtypecode);