Bugzilla – Attachment 129331 Details for
Bug 29858
Item.pm "Use of uninitialized value" warn when $field var is NULL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29858: NULL $field var causing "Use of uninitialized value" warn
Bug-29858-NULL-field-var-causing-Use-of-uninitiali.patch (text/plain), 959 bytes, created by
Peter Vashchuk
on 2022-01-12 11:14:37 UTC
(
hide
)
Description:
Bug 29858: NULL $field var causing "Use of uninitialized value" warn
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2022-01-12 11:14:37 UTC
Size:
959 bytes
patch
obsolete
>From ee58d118434c9e3bd12ad9cdfcb56a09f2bb073d Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Wed, 12 Jan 2022 13:13:56 +0200 >Subject: [PATCH] Bug 29858: NULL $field var causing "Use of uninitialized > value" warn > >Some fields might be null which causes "Use of >uninitialized value in string eq at .../Koha/Item.pm line 639." warn. >This patch prevents this warn to get thrown by checking if the field >is defined first. >--- > Koha/Item.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index d70fbc3f8f..2d1622144b 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -620,7 +620,7 @@ sub hidden_in_opac { > > foreach my $field ( keys %{$rules} ) { > >- if ( any { $self->$field eq $_ } @{ $rules->{$field} } ) { >+ if ( any { defined $self->$field and $self->$field eq $_ } @{ $rules->{$field} } ) { > $hidden_in_opac = 1; > last; > } >-- >2.31.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 29858
: 129331