From 6813eb9d11548b34da8e1efe15adee7b02c65dff Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 3 May 2023 13:24:11 +0200 Subject: [PATCH] #11090 Fix the count that gave an error when there are no tags and the sql error when putting offset-20 when there are no tag --- pandora_console/godmode/tag/tag.php | 3 ++- pandora_console/include/functions_alerts.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/tag/tag.php b/pandora_console/godmode/tag/tag.php index a36829c44b..083d8cc556 100644 --- a/pandora_console/godmode/tag/tag.php +++ b/pandora_console/godmode/tag/tag.php @@ -212,7 +212,8 @@ $filter['limit'] = (int) $config['block_size']; // Statements for pagination. $url = 'index.php?sec=gusuarios&sec2=godmode/tag/tag'; $total_tags = tags_get_tag_count($filter); -$offset_delete = ($offset >= ($total_tags - 1)) ? ($offset - $config['block_size']) : $offset; +$offset_delete = ($offset >= $total_tags ) ? ($offset - $config['block_size']) : 0; + $result = tags_search_tag(false, $filter); // Filter form. diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 0bb4216365..2252ceed07 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2149,8 +2149,9 @@ function get_group_alerts( break; } - // WHEN SELECT ALL TAGS TO FILTER ALERTS - $modules_tags = count(db_process_sql('select * from ttag')); + // WHEN SELECT ALL TAGS TO FILTER ALERTS. + $modules_tag_query = db_process_sql('select * from ttag'); + $modules_tags = ($modules_tag_query !== false) ? (count($modules_tag_query)) : false; $modules_user_tags = count(explode(',', $tag));