From 82f7a4db7b648df6d27c5a02004f7f8b8644a159 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Fri, 2 Dec 2022 11:22:11 -0500 Subject: [PATCH] PHP8.1 - prices must be numbers, not strings for arithmetic --- CRM/Price/BAO/LineItem.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 6399dade3d..b153763e2a 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -302,9 +302,10 @@ WHERE li.contribution_id = %1"; } foreach ($params["price_{$fid}"] as $oid => $qty) { - $price = $amount_override === NULL ? $options[$oid]['amount'] : $amount_override; + $qty = (int) $qty; + $price = (float) ($amount_override === NULL ? $options[$oid]['amount'] : $amount_override); - $participantsPerField = CRM_Utils_Array::value('count', $options[$oid], 0); + $participantsPerField = (int) CRM_Utils_Array::value('count', $options[$oid], 0); $values[$oid] = [ 'price_field_id' => $fid, -- 2.25.1