From fd94e585dac43e18fbe9d81c0ef89759d183410a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 21 Feb 2024 11:26:14 -0700 Subject: [PATCH] Update destinations.php - Use the database object more efficiently - Access the get method with this->get - Bypass cached destinations to avoid problems --- .../resources/classes/destinations.php | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/app/destinations/resources/classes/destinations.php b/app/destinations/resources/classes/destinations.php index 7ce2aa8162..eae818f2be 100644 --- a/app/destinations/resources/classes/destinations.php +++ b/app/destinations/resources/classes/destinations.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2017 - 2022 + Portions created by the Initial Developer are Copyright (C) 2017 - 2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -462,13 +462,10 @@ if (!class_exists('destinations')) { domain_uuid]['array'][$destination_type])) { - $_SESSION['destinations'][$this->domain_uuid]['array'][$destination_type] = $destination->get($destination_type); - } + $destinations = $this->get($destination_type); //get the destination label - foreach($_SESSION['destinations'][$this->domain_uuid]['array'][$destination_type] as $key => $value) { + foreach($destinations as $key => $value) { foreach($value as $k => $row) { if ($destination_value == $row['destination']) { $destination_key = $key; @@ -484,7 +481,7 @@ if (!class_exists('destinations')) { //build the destination select list in html $response .= " \n"; $response .= "