From ef6fc0ff2e0bfd015c061f52cc3f89236ed61ad2 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 13 Nov 2012 10:07:09 +0100 Subject: [PATCH] Fixing query in order to get the right count of rows in the session list see BT#5190 --- main/inc/lib/sessionmanager.lib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 01b61a2b59..ba19016ebd 100644 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -148,6 +148,8 @@ class SessionManager { static function get_count_admin($options = array()) { $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); + $tbl_session_field_values = Database::get_main_table(TABLE_MAIN_SESSION_FIELD_VALUES); + $tbl_session_field_options = Database::get_main_table(TABLE_MAIN_SESSION_FIELD_OPTIONS); $where = 'WHERE 1 = 1 '; $user_id = api_get_user_id(); @@ -168,7 +170,10 @@ class SessionManager { $where .= ' AND '.$options['where']; } - $query_rows = "SELECT count(*) as total_rows FROM $tbl_session s $where "; + $query_rows = "SELECT count(*) as total_rows FROM $tbl_session s + LEFT JOIN $tbl_session_field_values fv ON (fv.session_id = s.id) + INNER JOIN $tbl_session_field_options fvo ON (fv.field_id = fvo.field_id) + $where "; global $_configuration; if ($_configuration['multiple_access_urls']) {