Bug 28776

Summary: Warns from GetItemsInfo when biblio marked as serial
Product: Koha Reporter: Nick Clemens <nick>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, kyle, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.03,20.11.10
Bug Depends on:    
Bug Blocks: 25790    
Attachments: Bug 28776: Warns from GetItemsInfo when biblio marked as serial
Bug 28776: Warns from GetItemsInfo when biblio marked as serial
Bug 28776: Warns from GetItemsInfo when biblio marked as serial

Description Nick Clemens 2021-07-28 13:32:21 UTC
To recreate:
1 - Mark a record with items as serial in the marc (942$s)
2 - At least one of the items should have no enumchron defined
3 - Load the detail page
4 - Warns in logs:
    [WARN] Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/C4/Items.pm line 811.
Comment 1 Nick Clemens 2021-07-28 13:34:52 UTC
Created attachment 123251 [details] [review]
Bug 28776: Warns from GetItemsInfo when biblio marked as serial

GetItemsInfo sorts the items using serial fields if the biblio is
defined as a serial

The fields may not be defined. We can add a fallback to blank in this case

To test:
1 - Mark a record with items as serial in the marc (942$s)
2 - At least one of the items should have no enumchron defined
3 - Load the detail page
4 - Warns in logs:
    [WARN] Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/C4/Items.pm line 811.
5 - Apply patch and restart all
6 - Reload the details page
7 - No more warns
Comment 2 Fridolin Somers 2021-08-17 06:24:20 UTC
Created attachment 123865 [details] [review]
Bug 28776: Warns from GetItemsInfo when biblio marked as serial

GetItemsInfo sorts the items using serial fields if the biblio is
defined as a serial

The fields may not be defined. We can add a fallback to blank in this case

To test:
1 - Mark a record with items as serial in the marc (942$s)
2 - At least one of the items should have no enumchron defined
3 - Load the detail page
4 - Warns in logs:
    [WARN] Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/C4/Items.pm line 811.
5 - Apply patch and restart all
6 - Reload the details page
7 - No more warns

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

https://bugs.koha-community.org/show_bug.cgi?id=25790
Comment 3 Tomás Cohen Arazi 2021-08-17 13:05:17 UTC
Created attachment 123873 [details] [review]
Bug 28776: Warns from GetItemsInfo when biblio marked as serial

GetItemsInfo sorts the items using serial fields if the biblio is
defined as a serial

The fields may not be defined. We can add a fallback to blank in this case

To test:
1 - Mark a record with items as serial in the marc (942$s)
2 - At least one of the items should have no enumchron defined
3 - Load the detail page
4 - Warns in logs:
    [WARN] Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/C4/Items.pm line 811.
5 - Apply patch and restart all
6 - Reload the details page
7 - No more warns

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

https://bugs.koha-community.org/show_bug.cgi?id=25790
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Jonathan Druart 2021-08-18 13:36:34 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall 2021-08-20 17:58:27 UTC
Pushed to 21.05.x for 21.05.03
Comment 6 Fridolin Somers 2021-08-27 19:02:47 UTC
Pushed to 20.11.x for 20.11.10
Comment 7 Victor Grousset/tuxayo 2021-08-31 04:31:09 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.