resolved error with sql message error external tools2

This commit is contained in:
marcos 2021-03-29 16:54:41 +02:00
parent 96d63e2029
commit 5d38740630
2 changed files with 7 additions and 13 deletions

View File

@ -1011,7 +1011,7 @@ echo '<div class="action-buttons agent_manager" style="width: '.$table->width.'"
if ($modo == 0) { if ($modo == 0) {
echo "<span id='modules_not_learning_mode_context_help pdd_r_10px' '>"; echo "<span id='modules_not_learning_mode_context_help pdd_r_10px' '>";
} else { } else {
echo "<span id='modules_not_learning_mode_context_help invisible'>"; echo "<span id='modules_not_learning_mode_context_help' style='display:none'>";
} }
echo clippy_context_help('modules_not_learning_mode'); echo clippy_context_help('modules_not_learning_mode');

View File

@ -462,6 +462,12 @@ class ExternalTools extends HTML
$ids[] = join(',', $address); $ids[] = join(',', $address);
} }
// Must be an a IP at least for work.
if (empty($ids) === true) {
ui_print_message(__('The agent doesn`t have an IP yet'), 'error', true);
return;
}
$ips = db_get_all_rows_sql( $ips = db_get_all_rows_sql(
sprintf( sprintf(
'SELECT ip FROM taddress WHERE id_a IN (%s)', 'SELECT ip FROM taddress WHERE id_a IN (%s)',
@ -469,18 +475,6 @@ class ExternalTools extends HTML
) )
); );
// Must be an a IP at least for work.
if (empty($ips) === true) {
html_print_div(
[
'class' => 'error',
'style' => 'margin-top:5px',
'content' => __('The agent hasn\'t got IP'),
]
);
return;
}
// Make the data for show in table. // Make the data for show in table.
$ipsSelect = array_reduce( $ipsSelect = array_reduce(
$ips, $ips,