From 1dc594705842e620e5d734ebe31885892f0c5faf Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 22 Dec 2023 12:38:15 +1300 Subject: [PATCH] [PHP8.2] Fix test fails on event cart --- ext/eventcart/CRM/Event/Cart/Form/Cart.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ext/eventcart/CRM/Event/Cart/Form/Cart.php b/ext/eventcart/CRM/Event/Cart/Form/Cart.php index 048c2ba5b9..f585cd92cf 100644 --- a/ext/eventcart/CRM/Event/Cart/Form/Cart.php +++ b/ext/eventcart/CRM/Event/Cart/Form/Cart.php @@ -23,13 +23,11 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { $this->checkWaitingList(); - $this->assignBillingType(); - $event_titles = []; foreach ($this->cart->get_main_events_in_carts() as $event_in_cart) { $event_titles[] = $event_in_cart->event->title; } - $this->description = ts("Online Registration for %1", [1 => implode(", ", $event_titles)]); + if (!isset($this->discounts)) { $this->discounts = []; } @@ -91,9 +89,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { if (is_string($empty_seats)) { return 0; } - else { - return NULL; - } + return NULL; } /** @@ -114,8 +110,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { } // check if the user is registered and we have a contact ID - $session = CRM_Core_Session::singleton(); - return $session->get('userID'); + return CRM_Core_Session::getLoggedInContactID(); } /** -- 2.25.1