diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 26e34f80aa..d32b15e1aa 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1544,11 +1544,14 @@ function loadFieldsFromDB(item) { if (key == 'linked_layout_status_type') $("select[name=linked_map_status_calculation_type]").val(val).change(); if (key == 'id_layout_linked') { - if (data['linked_layout_node_id'] == null) + if (data['linked_layout_node_id'] == null) { $("select[name=map_linked]").val(val).change(); - else - $("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]") - .prop("selected", true).change(); + } + else { + var $option = $("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]"); + if ($option.length === 0) $option = $("select[name=map_linked] > option[value=" + val + "]"); + $option.prop("selected", true).parent().change(); + } } if (key == 'linked_layout_node_id') $("input[name=linked_map_node_id]").val(val); diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 7994dd2f19..a20a8c5e42 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -773,6 +773,10 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items_advance['map_linked_row']['html'] .= ob_get_clean(); } else { + $visual_maps = array_reduce($visual_maps, function ($all, $item) { + $all[$item["id"]] = $item["name"]; + return $all; + }, array()); $form_items_advance['map_linked_row']['html'] .= html_print_select( $visual_maps, 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true );