From 56aec87ddcb04105b2d2f10d6c8df95a7741e657 Mon Sep 17 00:00:00 2001 From: olayiwola-compucorp Date: Fri, 29 Sep 2023 06:58:42 +0100 Subject: [PATCH] CIWEMB-514: Fix not able to create non-salesorder contribution --- CRM/Civicase/Hook/Post/CaseSalesOrderPayment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Civicase/Hook/Post/CaseSalesOrderPayment.php b/CRM/Civicase/Hook/Post/CaseSalesOrderPayment.php index 894a0d81a..a729856e9 100644 --- a/CRM/Civicase/Hook/Post/CaseSalesOrderPayment.php +++ b/CRM/Civicase/Hook/Post/CaseSalesOrderPayment.php @@ -41,8 +41,8 @@ public function run($op, $objectName, $objectId, &$objectRef) { ->execute() ->first(); - $this->updateQuotationFinancialStatuses($contribution['Opportunity_Details.Quotation']); - $this->updateCaseOpportunityFinancialDetails($contribution['Opportunity_Details.Case_Opportunity']); + $this->updateQuotationFinancialStatuses($contribution['Opportunity_Details.Quotation'] ?: NULL); + $this->updateCaseOpportunityFinancialDetails($contribution['Opportunity_Details.Case_Opportunity'] ?: NULL); } /** @@ -51,7 +51,7 @@ public function run($op, $objectName, $objectId, &$objectRef) { * @param int $salesOrderID * CaseSalesOrder ID. */ - private function updateQuotationFinancialStatuses(int $salesOrderID): void { + private function updateQuotationFinancialStatuses(?int $salesOrderID): void { if (empty($salesOrderID)) { return; }