Bug 41044

Summary: Fix argument isn't numeric in addition in Koha::Item::find_booking
Product: Koha Reporter: Lari Taskula <lari.taskula>
Component: Architecture, internals, and plumbingAssignee: Lari Taskula <lari.taskula>
Status: Pushed to main --- QA Contact: Paul Derscheid <paul.derscheid>
Severity: trivial    
Priority: P5 - low CC: david, paul.derscheid
Version: unspecified   
Hardware: All   
OS: All   
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
Bug 41044: Fix warning
Bug 41044: Add a failing test
Bug 41044: Fix warning
Bug 41044: Add a failing test
Bug 41044: Fix warning

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