Update destinations.php

The &$row pointer caused a duplicate in the interface on the last row when used with updating the $row['action'] value. 

Used an alternative method to update the destinations array and it solved the appearance of a duplicate.
This commit is contained in:
FusionPBX
2024-05-06 17:33:48 -06:00
committed by GitHub
parent 04ee47ce8f
commit 8657a68d7e

View File

@@ -241,7 +241,8 @@
//update the array to add the actions
if (!$show == "all") {
foreach ($destinations as &$row) {
$x = 0;
foreach ($destinations as $row) {
if (!empty($row['destination_actions'])) {
//prepare the destination actions
if (!empty(json_decode($row['destination_actions'], true))) {
@@ -252,14 +253,15 @@
//add the actions to the array
$actions = action_name($destination_array, $destination_app_data);
$row['actions'] = (!empty($actions)) ? implode(', ', $actions) : '';
$destinations[$x]['actions'] = (!empty($actions)) ? implode(', ', $actions) : '';
//empty the array before the next iteration
unset($destination_app_data);
}
else {
$row['actions'] = '';
$destinations[$x]['actions'] = '';
}
$x++;
}
}