From: Jon Goldberg Date: Fri, 2 Dec 2022 16:22:11 +0000 (-0500) Subject: PHP8.1 - prices must be numbers, not strings for arithmetic X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=82f7a4db7b648df6d27c5a02004f7f8b8644a159;p=civicrm-core.git PHP8.1 - prices must be numbers, not strings for arithmetic --- 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,