From 2ea90bfc523aab715891ac759a2c39ddaa2c0191 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 19 Oct 2022 13:48:15 -0600 Subject: [PATCH] Copy of the domain array and used it in dialplan import --- core/domains/domain_edit.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index 2f853b36bd..8616cf2c4c 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.php @@ -132,10 +132,17 @@ //add the domain name $domain_enabled = 'true'; $domain_uuid = uuid(); + + //build the domain array $array['domains'][0]['domain_uuid'] = $domain_uuid; $array['domains'][0]['domain_name'] = $domain_name; $array['domains'][0]['domain_enabled'] = $domain_enabled; $array['domains'][0]['domain_description'] = $domain_description; + + //create a copy of the domain array as the database save method empties the array that we still need. + $domain_array = $array; + + //add the new domain $database = new database; $database->app_name = 'domains'; $database->app_uuid = '8b91605b-f6d2-42e6-a56d-5d1ded01bb44'; @@ -145,7 +152,7 @@ if (file_exists($_SERVER["PROJECT_ROOT"]."/app/dialplans/app_config.php")) { //import the dialplans $dialplan = new dialplan; - $dialplan->import($array['domains']); + $dialplan->import($domain_array['domains']); unset($array); //add xml for each dialplan where the dialplan xml is empty