diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 4b8a0ba9cc..ff22930488 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -168,6 +168,19 @@ $dashboard_uuid = uuid(); } + //remove empty values and convert to json + if (!empty($dashboard_number_background_color)) { + if (is_array($dashboard_number_background_color)) { + $dashboard_number_background_color = array_filter($dashboard_number_background_color); + if (count($dashboard_number_background_color) > 0) { + $dashboard_number_background_color = json_encode($dashboard_number_background_color); + } + else { + $dashboard_number_background_color = ''; + } + } + } + //prepare the array $array['dashboard'][0]['dashboard_uuid'] = $dashboard_uuid; $array['dashboard'][0]['dashboard_name'] = $dashboard_name; @@ -194,7 +207,7 @@ } } } - +//view_array($array); //save the data $database = new database; $database->app_name = 'dashboard'; @@ -278,6 +291,11 @@ $dashboard_group_uuid = uuid(); } +//convert the json to an array + if (!empty($dashboard_number_background_color) && is_json($dashboard_number_background_color)) { + $dashboard_number_background_color = json_decode($dashboard_number_background_color, true); + } + //add a default value to $dashboard_details_state if (!isset($dashboard_details_state)) { $dashboard_details_state = "expanded"; @@ -391,10 +409,11 @@ echo "