When copying a dialplan use a unique uuid for app_uuid.

This commit is contained in:
FusionPBX 2021-10-29 13:06:17 -06:00 committed by GitHub
parent a83abc96d1
commit 0004a44d1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1386,11 +1386,15 @@
if (is_array($rows) && @sizeof($rows) != 0) {
$y = 0;
foreach ($rows as $x => $row) {
//set a unique uuid
$primary_uuid = uuid();
//copy data
$array[$this->table][$x] = $row;
//dialplan copy should have a unique app_uuid
$array[$this->table][$x]['app_uuid'] = uuid();
//overwrite
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $primary_uuid;
$array[$this->table][$x]['dialplan_description'] = trim($row['dialplan_description'].' ('.$text['label-copy'].')');
@ -1436,6 +1440,7 @@
$database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid;
$database->save($array);
//view_array($database->message);
unset($array);
//revoke temporary permissions