From 8657a68d7ee574b9ac6cc550222a829ddf5ddab5 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 6 May 2024 17:33:48 -0600 Subject: [PATCH] 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. --- app/destinations/destinations.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index a53d6e785d..43b19f5787 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -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++; } }