From 1271063b00f4ede05d7f358f8a229de0511dd24d Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 31 Oct 2025 15:49:43 -0600 Subject: [PATCH] Fix dialplans update $app_uuid handling in dialplan edit and database arrays --- app/dialplans/dialplan_edit.php | 5 ++++- app/dialplans/resources/classes/dialplan.php | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/dialplans/dialplan_edit.php b/app/dialplans/dialplan_edit.php index 9b5c9f5abb..5020cf5892 100644 --- a/app/dialplans/dialplan_edit.php +++ b/app/dialplans/dialplan_edit.php @@ -89,6 +89,9 @@ if (!empty($_REQUEST["app_uuid"]) && is_uuid($_REQUEST["app_uuid"])) { $app_uuid = $_REQUEST["app_uuid"]; } + else { + $app_uuid = null; + } //get the http post values and set them as php variables if (count($_POST) > 0) { @@ -300,7 +303,7 @@ } } - //update the dialplan xml by using the array + //update the dialplan_xml by using the array $dialplans = new dialplan; $dialplans->source = "details"; $dialplans->destination = "array"; diff --git a/app/dialplans/resources/classes/dialplan.php b/app/dialplans/resources/classes/dialplan.php index d3391a41d1..d990d28b13 100644 --- a/app/dialplans/resources/classes/dialplan.php +++ b/app/dialplans/resources/classes/dialplan.php @@ -38,6 +38,7 @@ * @var string */ public $domain_uuid; + public $app_uuid; /** * declare public variables @@ -551,10 +552,10 @@ foreach($database_array['dialplans'] as $row) { if (!empty($row['dialplan_details'])) { foreach($row['dialplan_details'] as $detail) { - if ($detail['dialplan_detail_enabled'] == true) { + if ($detail['dialplan_detail_enabled'] == 'true') { $array[$id]['domain_uuid'] = $row['domain_uuid']; $array[$id]['dialplan_uuid'] = $row['dialplan_uuid']; - $array[$id]['app_uuid'] = $row['app_uuid']; + $array[$id]['app_uuid'] = $row['app_uuid'] ?? ''; $array[$id]['dialplan_context'] = $row['dialplan_context']; $array[$id]['dialplan_name'] = $row['dialplan_name']; $array[$id]['dialplan_number'] = $row['dialplan_number'];