From 368ad20227660b793031b8df6e1ffcf2c771b25f Mon Sep 17 00:00:00 2001 From: Mendel <44873735+rabbidiesel@users.noreply.github.com> Date: Wed, 29 Apr 2026 19:35:30 -0400 Subject: [PATCH] Fix destination export to honor Show All across domains (#7936) When SHOW ALL button has been pressed then export all destinations from all domains and add '_all' to the exported file name. --- app/destinations/destination_download.php | 15 +++++++++++---- app/destinations/destinations.php | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/destinations/destination_download.php b/app/destinations/destination_download.php index 5958784bb..6d82ffba0 100644 --- a/app/destinations/destination_download.php +++ b/app/destinations/destination_download.php @@ -144,13 +144,17 @@ } } if (is_array($selected_columns) && @sizeof($selected_columns) != 0) { + $show_all = (!empty($_REQUEST['show']) && $_REQUEST['show'] == 'all' && permission_exists('destination_all')); $sql = "select ".implode(', ', $selected_columns)." from v_destinations "; - $sql .= "where domain_uuid = :domain_uuid "; - $parameters['domain_uuid'] = $domain_uuid; - $destinations = $database->select($sql, $parameters, 'all'); + if (!$show_all) { + $sql .= "where domain_uuid = :domain_uuid "; + $parameters['domain_uuid'] = $domain_uuid; + } + $destinations = $database->select($sql, $parameters ?? null, 'all'); unset($sql, $parameters, $selected_columns); - download_send_headers("destination_export_".date("Y-m-d").".csv"); + $filename_suffix = $show_all ? '_all' : ''; + download_send_headers("destination_export".$filename_suffix."_".date("Y-m-d").".csv"); echo array2csv($destinations); exit; } @@ -166,6 +170,9 @@ //show the content echo "