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.
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'
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'
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.
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.
Created attachment 178920 [details] [review] 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>
Trivial. Self SO Cane across this one in 23.11. Still in master too.
Created attachment 179050 [details] [review] 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>
Pushed for 25.05! Well done everyone, thank you!