Bugzilla – Attachment 101147 Details for
Bug 20443
Move C4::Members::Attributes to Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20443: Do not explode if attribute does not have a valid av
Bug-20443-Do-not-explode-if-attribute-does-not-hav.patch (text/plain), 1.32 KB, created by
Jonathan Druart
on 2020-03-20 14:48:31 UTC
(
hide
)
Description:
Bug 20443: Do not explode if attribute does not have a valid av
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-20 14:48:31 UTC
Size:
1.32 KB
patch
obsolete
>From 45eba002dc2c9a99caccb3f6cc3b00915f111a33 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 9 Mar 2020 11:02:54 +0100 >Subject: [PATCH] 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: Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Patron/Attribute.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron/Attribute.pm b/Koha/Patron/Attribute.pm >index 9118a7f812..5afd674149 100644 >--- a/Koha/Patron/Attribute.pm >+++ b/Koha/Patron/Attribute.pm >@@ -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; > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20443
:
101122
|
101123
|
101124
|
101125
|
101126
|
101127
|
101128
|
101129
|
101130
|
101131
|
101132
|
101133
|
101134
|
101135
|
101136
|
101137
|
101138
|
101139
|
101140
|
101141
|
101142
|
101143
|
101144
|
101145
|
101146
|
101147
|
101148
|
101149
|
101150
|
101209
|
101210
|
101211
|
101212
|
101213
|
101214
|
101215
|
101216
|
101217
|
101218
|
101219
|
101220
|
101221
|
101222
|
101223
|
101224
|
101225
|
101226
|
101227
|
101228
|
101229
|
101230
|
101231
|
101232
|
101233
|
101234
|
101235
|
101236
|
101237
|
101472
|
104519