Bug 27539

Summary: Warnings "Use of uninitialized value in split" on "Holds to pull" page
Product: Koha Reporter: Peter Vashchuk <stalkernoid>
Component: CirculationAssignee: Peter Vashchuk <stalkernoid>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, gmcharlt, kyle.m.hall, nugged
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 25790    
Attachments: Bug 27539: fix console warnings "Use of uninitialized value in split"

Description Peter Vashchuk 2021-01-24 20:03:15 UTC

    
Comment 1 Peter Vashchuk 2021-01-24 20:09:18 UTC
Created attachment 115731 [details] [review]
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.
Comment 2 David Nind 2021-06-05 21:15:43 UTC
Hi Peter.

I can't seem to replicate the warning message appearing in any of the log files or the browser console.

I have checked the database for the items I have placed holds on and they have NULL as the value for call number, copy number and enumeration.

Have tried both a record level and an item level hold.

I'm testing using koha-testing-docker and on master.

David
Comment 3 Peter Vashchuk 2021-06-07 14:46:50 UTC
(In reply to David Nind from comment #2)

Hey David.

Looks like since commit 2285c2d6 the file structure in the master changed pretty drastically, it moved away from raw SQL SELECT to DBIx::Class, which means no more "splits" that produce this exact warning.

Basically what you're saying is correct, ticket and patch are obsolete now.
Comment 4 David Nind 2021-06-07 19:45:58 UTC
Thanks Peter for having a look.

It's good that it is fixed!

I have changed the status for this bug to resolved.

David