Bugzilla – Attachment 115731 Details for
Bug 27539
Warnings "Use of uninitialized value in split" on "Holds to pull" page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27539: fix console warnings "Use of uninitialized value in split"
Bug-27539-fix-console-warnings-Use-of-uninitialize.patch (text/plain), 2.87 KB, created by
Peter Vashchuk
on 2021-01-24 20:09:18 UTC
(
hide
)
Description:
Bug 27539: fix console warnings "Use of uninitialized value in split"
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2021-01-24 20:09:18 UTC
Size:
2.87 KB
patch
obsolete
>From f1b1e362b731e525b760a9aa500b1bf6c80cf0fc Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Sun, 24 Jan 2021 22:08:05 +0200 >Subject: [PATCH] Bug 27539: fix console warnings "Use of uninitialized value > in split" > >When items in the database have NULLs for some fields, those are SELECTed as undefs and those values arrive as strings to be splitted by "split" command, and that produces undef warnings. That is expected behaviour to not have data for those fields sometimes, so we just need to add perl's "defaulting" to empty strings for split. > >To reproduce: > 1) Place a hold on an item that has an available call number, copy numbers or enumeration empty. > 2) Head to the Holds to Pull page and check the console to see "Use of uninitialized value in split" errors. > 3) Apply the patch. > 4) Refresh the Holds to Pull page and check the console again to ensure that new errors about "Use of uninitialized value in split" weren't added. >--- > circ/pendingreserves.pl | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index 01cf877b55..122ed9a48d 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -263,17 +263,17 @@ while ( my $data = $sth->fetchrow_hashref ) { > author => $data->{author}, > borrowernumber => $data->{borrowernumber}, > biblionumber => $data->{biblionumber}, >- holdingbranches => [split('\|', $data->{l_holdingbranch})], >+ holdingbranches => [split('\|', $data->{l_holdingbranch} // '')], > branch => $data->{l_branch}, >- itemcallnumber => [split('\|', $data->{l_itemcallnumber})], >- enumchron => [split('\|', $data->{l_enumchron})], >- copyno => [split('\|', $data->{l_copynumber})], >- barcode => [split('\|', $data->{l_barcode})], >+ itemcallnumber => [split('\|', $data->{l_itemcallnumber} // '')], >+ enumchron => [split('\|', $data->{l_enumchron} // '')], >+ copyno => [split('\|', $data->{l_copynumber} // '')], >+ barcode => [split('\|', $data->{l_barcode} // '')], > count => $data->{icount}, > rcount => $data->{rcount}, > pullcount => $data->{icount} <= $data->{rcount} ? $data->{icount} : $data->{rcount}, >- itemTypes => [split('\|', $data->{l_item_type})], >- locations => [split('\|', $data->{l_location})], >+ itemTypes => [split('\|', $data->{l_item_type} // '')], >+ locations => [split('\|', $data->{l_location} // '')], > reserve_id => $data->{reserve_id}, > holdingbranch => $data->{holdingbranch}, > homebranch => $data->{homebranch}, >-- >2.28.0
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 27539
: 115731