Bug 41044 - Fix argument isn't numeric in addition in Koha::Item::find_booking
Summary: Fix argument isn't numeric in addition in Koha::Item::find_booking
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial
Assignee: Lari Taskula
QA Contact: Paul Derscheid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-17 11:42 UTC by Lari Taskula
Modified: 2025-10-31 21:31 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 41044: Add a failing test (2.09 KB, patch)
2025-10-17 12:17 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 41044: Fix warning (841 bytes, patch)
2025-10-17 12:17 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 41044: Add a failing test (2.13 KB, patch)
2025-10-25 22:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 41044: Fix warning (888 bytes, patch)
2025-10-25 22:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 41044: Add a failing test (2.19 KB, patch)
2025-10-31 14:39 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 41044: Fix warning (949 bytes, patch)
2025-10-31 14:39 UTC, Paul Derscheid
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2025-10-17 11:42:11 UTC

    
Comment 1 Lari Taskula 2025-10-17 12:17:20 UTC Comment hidden (obsolete)
Comment 2 Lari Taskula 2025-10-17 12:17:21 UTC Comment hidden (obsolete)
Comment 3 David Nind 2025-10-25 21:56:03 UTC Comment hidden (obsolete)
Comment 4 David Nind 2025-10-25 22:00:35 UTC
Created attachment 188447 [details] [review]
Bug 41044: Add a failing test

To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe failing test

Subtest: test empty string warning
        1..1
        not ok 1 - No warnings were produced
           Failed test 'No warnings were produced'
           at t/db_dependent/Koha/Item.t line 3656.
         found warning: Argument "" isn't numeric in addition (+) at /usr/local/lib/x86_64-linux-gnu/perl/5.34.0/DateTime/Duration.pm line 70.
         didn't expect to find a warning
         Looks like you failed 1 test of 1.
    not ok 9 - test empty string warning
       Failed test 'test empty string warning'
       at t/db_dependent/Koha/Item.t line 3657.
     Looks like you failed 1 test of 9.
Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2025-10-25 22:00:38 UTC
Created attachment 188448 [details] [review]
Bug 41044: Fix warning

To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe success

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2025-10-25 22:01:37 UTC
(In reply to David Nind from comment #3)
> I'm not getting any test failures on the current main and latest KTD.

Please ignore, I didn't test correctly!

Testing notes (using KTD):

1. Apply the first patch - tests should fail.

2. Apply the second patch - test now pass!
Comment 7 Paul Derscheid 2025-10-31 14:39:43 UTC
Created attachment 188826 [details] [review]
Bug 41044: Add a failing test

To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe failing test

Subtest: test empty string warning
        1..1
        not ok 1 - No warnings were produced
           Failed test 'No warnings were produced'
           at t/db_dependent/Koha/Item.t line 3656.
         found warning: Argument "" isn't numeric in addition (+) at /usr/local/lib/x86_64-linux-gnu/perl/5.34.0/DateTime/Duration.pm line 70.
         didn't expect to find a warning
         Looks like you failed 1 test of 1.
    not ok 9 - test empty string warning
       Failed test 'test empty string warning'
       at t/db_dependent/Koha/Item.t line 3657.
     Looks like you failed 1 test of 9.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 8 Paul Derscheid 2025-10-31 14:39:45 UTC
Created attachment 188827 [details] [review]
Bug 41044: Fix warning

To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe success

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 9 Lucas Gass (lukeg) 2025-10-31 21:31:19 UTC
Nice work everyone!

Pushed to main for 25.11