Bug 20443: Do not explode if attribute does not have a valid av
Template process failed: undef error - Can't call method "lib" on an undefined value at /kohadevbox/koha/Koha/Patron/Attribute.pm line 109. at /kohadevbox/koha/C4/Templates.pm line 122 We should not crash as it if the attribute is linked to an invalid authorised value (for instance the AV has been deleted) We must provide a check in the search_for_data_inconsistencies.pl script Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
fc430529c1
commit
994ea386c3
1 changed files with 2 additions and 1 deletions
|
@ -106,7 +106,8 @@ displayed instead of the code.
|
|||
sub description {
|
||||
my ( $self) = @_;
|
||||
if ( $self->type->authorised_value_category ) {
|
||||
return $self->authorised_value->lib;
|
||||
my $av = $self->authorised_value;
|
||||
return $av ? $av->lib : "";
|
||||
}
|
||||
return $self->attribute;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue