From bfa8d703e7f93088fb7ae8378c440aaaa406c527 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 22 Oct 2020 11:35:07 +0200 Subject: [PATCH] Fixed api create_event autovalidation on meta --- pandora_console/include/functions_api.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 6401910faa..2b96c52978 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -12513,7 +12513,13 @@ function api_set_create_event($id, $trash1, $other, $returnType) if ($other['data'][18] != '') { $values['id_extra'] = $other['data'][18]; - $sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";'; + if (is_metaconsole()) { + $table_event = 'tmetaconsole_event'; + } else { + $table_event = 'tevento'; + } + + $sql_validation = 'SELECT id_evento FROM '.$table_event.' where estado IN (0,2) and id_extra ="'.$other['data'][18].'";'; $validation = db_get_all_rows_sql($sql_validation); if ($validation) { foreach ($validation as $val) {