Bugzilla – Attachment 188258 Details for
Bug 35423
AuthoritiesMarc: Warnings substr outside of string and Use of uninitialized value $type in string eq
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35423: Fix substr outside of string warning
Bug-35423-Fix-substr-outside-of-string-warning.patch (text/plain), 1.76 KB, created by
Lari Taskula
on 2025-10-21 19:40:10 UTC
(
hide
)
Description:
Bug 35423: Fix substr outside of string warning
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-10-21 19:40:10 UTC
Size:
1.76 KB
patch
obsolete
>From 8081e62dcd3de03f44fd195ec07ff2efd089232d Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 21 Oct 2025 22:34:18 +0300 >Subject: [PATCH] Bug 35423: Fix substr outside of string warning > >To test: > >Before applying patch > >1. Create an authority record, fill field 400$w with "n" >2. Search for the authority you just created >3. Observe a warning has been logged > >"substr outside of string" > >4. Apply patch >5. Refresh the search results from step 2 >6. Observe no warnings have been logged >--- > C4/AuthoritiesMarc.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 581ab42eca7..e0bf9298da7 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1084,7 +1084,7 @@ sub BuildSummary { > my $type = 'seefrom'; > $type = ( $marc21controlrefs{ substr $field->subfield('w'), 0, 1 } || '' ) if ( $field->subfield('w') ); > if ( $type eq 'notapplicable' ) { >- $type = substr $field->subfield('w'), 2, 1; >+ $type = substr $field->subfield('w'), 2, 1 if length( $field->subfield('w') ) > 2; > $type = 'earlier' if $type && $type ne 'n'; > } > if ( $type eq 'subfi' ) { >@@ -1107,7 +1107,7 @@ sub BuildSummary { > my $type = 'seealso'; > $type = ( $marc21controlrefs{ substr $field->subfield('w'), 0, 1 } || '' ) if ( $field->subfield('w') ); > if ( $type eq 'notapplicable' ) { >- $type = substr $field->subfield('w'), 2, 1; >+ $type = substr $field->subfield('w'), 2, 1 if length( $field->subfield('w') ) > 2; > $type = 'earlier' if $type && $type ne 'n'; > } > if ( $type eq 'subfi' ) { >-- >2.34.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 35423
: 188258