Bug 27539 - Warnings "Use of uninitialized value in split" on "Holds to pull" page
Summary: Warnings "Use of uninitialized value in split" on "Holds to pull" page
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Peter Vashchuk
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25790
  Show dependency treegraph
 
Reported: 2021-01-24 20:03 UTC by Peter Vashchuk
Modified: 2022-05-17 11:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 27539: fix console warnings "Use of uninitialized value in split" (2.87 KB, patch)
2021-01-24 20:09 UTC, Peter Vashchuk
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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