[Bug 29410] New: Dates compared arithmetically in MsgType.pm (warns: Argument isn't numeric in numeric ne)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Bug ID: 29410 Summary: Dates compared arithmetically in MsgType.pm (warns: Argument isn't numeric in numeric ne) Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: nugged@gmail.com QA Contact: testopia@bugs.koha-community.org Regular warnings a-la: Argument "2021-11-04" isn't numeric in numeric ne (!=) at /usr/share/koha/lib/C4/SIP/Sip/MsgType.pm line 1265. emitted in C4::SIP::Sip::MsgType handle_item_information sub. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 --- Comment #1 from Andrew Nugged <nugged@gmail.com> --- there are two pieces of the code: if ( ( $i = $item->recall_date ) != 0 ) { $resp .= add_field( FID_RECALL_DATE, timestamp($i), $server ); } if ( ( $i = $item->hold_pickup_date ) != 0 ) { $resp .= add_field( FID_HOLD_PICKUP_DATE, timestamp($i), $server ); } when those emits the error, Argument "2021-11-04" isn't numeric in numeric ne (!=) at /usr/share/koha/lib/C4/SIP/Sip/MsgType.pm I that dumped, 'C4::SIP::ILS::Item=HASH(0x556838ade6a8)' comes with hold_pickup_date '2021-11-04' which is 'SCALAR' -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 --- Comment #2 from Andrew Nugged <nugged@gmail.com> --- there are two pieces of the code: if ( ( $i = $item->recall_date ) != 0 ) { $resp .= add_field( FID_RECALL_DATE, timestamp($i), $server ); } if ( ( $i = $item->hold_pickup_date ) != 0 ) { $resp .= add_field( FID_HOLD_PICKUP_DATE, timestamp($i), $server ); } when those emits the warning, Argument "2021-11-04" isn't numeric in numeric ne (!=) at /usr/share/koha/lib/C4/SIP/Sip/MsgType.pm I that dumped, 'C4::SIP::ILS::Item=HASH(0x556838ade6a8)' comes with hold_pickup_date '2021-11-04' which is 'SCALAR' -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 --- Comment #3 from Andrew Nugged <nugged@gmail.com> --- more notes: $item->due_date comes in as DateTime object once, '2021-12-03T23:59:00', ref: 'DateTime' but it also comes as scalar '0'. $item->hold_pickup_date comes in as scalar '2021-11-11', ref: '' it also comes as scalar '0'. $item->recall_date comes as scalar '0', I didn't yet figure out in which kind it comes when it has non-zero. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Blocks| |25790 Depends on| |5601 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- See also commit d4842d45601bd0f9c1bd33bf7978586ae746888f Bug 5601 Fix processing of DueDate return I think it would make sense to apply the same change for both recall_date and hold_pickup_date. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5601 [Bug 5601] SIP Due dates miscalculated via DateTime https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|25790 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 178920 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178920&action=edit Bug 29410: Resolve warn on numeric ne for two dates Simply, remove the !=0 test. Test for true. Test plan: Restart SIP. Ask item info (SIP 17) on a waiting hold. It must have a hold pickup date. Check that warn disappears with this patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Trivial. Self SO Cane across this one in 23.11. Still in master too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178920|0 |1 is obsolete| | --- Comment #7 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 179050 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179050&action=edit Bug 29410: Resolve warn on numeric ne for two dates Simply, remove the !=0 test. Test for true. Test plan: Restart SIP. Ask item info (SIP 17) on a waiting hold. It must have a hold pickup date. Check that warn disappears with this patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de QA Contact|testopia@bugs.koha-communit |paul.derscheid@lmscloud.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com Status|Pushed to main |Pushed to stable Version(s)|25.05.00 |25.05.00,24.11.08 released in| | --- Comment #9 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Pushed into 24.11.x for 24.11.08 nice work everyone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29410 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #10 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org