From 7acd687b9baf57e67290417a32daf2acbc5aba52 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 31 Jan 2024 09:21:27 +0100 Subject: [PATCH] #12687 Fixed export with json_ref --- pandora_console/include/class/Prd.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/Prd.class.php b/pandora_console/include/class/Prd.class.php index 7f562bf8b2..1b47819f42 100644 --- a/pandora_console/include/class/Prd.class.php +++ b/pandora_console/include/class/Prd.class.php @@ -1809,6 +1809,13 @@ class Prd $result .= $column.'['.$primary_key.']="'.$value.'"'.LINE_BREAK; } else if (isset($json_ref[$column]) === true) { + if (isset($this->base64Refs[$element['table']]) === true + && empty($value) === false + && reset($this->base64Refs[$element['table']]) === $column + ) { + $value = base64_decode($value); + } + $json_array = json_decode($value, true); foreach ($json_ref[$column] as $json_key => $json_value) { if (isset($json_array[$json_key]) === true) { @@ -1825,7 +1832,7 @@ class Prd $value = db_get_row_sql($sql_json); $new_array = []; - $new_array[$json_value['ref']['columns']] = io_safe_output($value); + $new_array[$json_value['ref']['table']] = io_safe_output($value); $json_array[$json_key] = $new_array; } }