Bug 35423

Summary: AuthoritiesMarc: Warnings substr outside of string and Use of uninitialized value $type in string eq
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 2505    
Attachments: Bug 35423: Fix substr outside of string warning

Description Marcel de Rooy 2023-11-28 15:19:04 UTC
In full:

substr outside of string at /usr/share/koha/C4/AuthoritiesMarc.pm line 1041.
Use of uninitialized value $type in string eq at /usr/share/koha/C4/AuthoritiesMarc.pm line 1044.

May be found in your logs (depending on data) when calling SearchAuthorities.
Comment 1 Lari Taskula 2025-10-21 19:40:10 UTC
Created attachment 188258 [details] [review]
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