Bugzilla – Attachment 140363 Details for
Bug 31535
Fix a staff warn or two
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31535: Fix warning - uninitialized value in string ne (MARCdetail.pl)
Bug-31535-Fix-warning---uninitialized-value-in-str.patch (text/plain), 1.68 KB, created by
Marcel de Rooy
on 2022-09-09 07:45:31 UTC
(
hide
)
Description:
Bug 31535: Fix warning - uninitialized value in string ne (MARCdetail.pl)
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-09-09 07:45:31 UTC
Size:
1.68 KB
patch
obsolete
>From e26d7867914faf148ac184f60f4d4644e92b5b12 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 8 Sep 2022 14:13:36 +0000 >Subject: [PATCH] Bug 31535: Fix warning - uninitialized value in string ne > (MARCdetail.pl) >Content-Type: text/plain; charset=utf-8 > >Spotted at line 183 (older Koha version). > >Test plan: >You need a NULL in the tab column of marc_subfield_structure. Hit this >page and check the logs. >This might convince you easier: > my $tabloop=0; my $x; print "Empty string - True\n" if ( $x // q{} ) ne $tabloop; > print "Zero - True\n" if ( $x // '0' ) ne $tabloop; >You should only see: Empty string - True proving that defaulting to '0' >would be a game changer. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > catalogue/MARCdetail.pl | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > >diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl >index 92ec114109..3f5e03a090 100755 >--- a/catalogue/MARCdetail.pl >+++ b/catalogue/MARCdetail.pl >@@ -183,10 +183,7 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { > # loop through each subfield > for my $i ( 0 .. $#subf ) { > $subf[$i][0] = "@" unless defined $subf[$i][0]; >- next >- if ( >- $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{tab} >- ne $tabloop ); >+ next if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{tab} // q{} ) ne $tabloop; # Note: defaulting to '0' changes behavior! > next > if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] } > ->{hidden} =~ /-7|-4|-3|-2|2|3|5|8/); >-- >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 31535
:
140343
|
140362
|
140363
|
140364
|
140463
|
140464
|
140465