Skip to content

Commit

Permalink
Fix Forum Thread Count - Refs #7928
Browse files Browse the repository at this point in the history
  • Loading branch information
jloguercio committed Nov 13, 2015
1 parent 5166be6 commit ce76804
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main/forum/forumfunction.inc.php
Expand Up @@ -1462,6 +1462,8 @@ function get_forums(
} else {
$session_id = $sessionId;
}

$sessionIdLink = ($session_id === 0) ? '' : 'AND threads.session_id = item_properties.session_id';

$condition_session = api_get_session_condition(
$session_id,
Expand Down Expand Up @@ -1501,8 +1503,8 @@ function get_forums(
INNER JOIN ".$table_item_property." item_properties
ON (
threads.thread_id=item_properties.ref AND
threads.c_id = item_properties.c_id AND
threads.session_id = item_properties.session_id
threads.c_id = item_properties.c_id
$sessionIdLink
)
WHERE
item_properties.visibility=1 AND
Expand Down Expand Up @@ -1550,8 +1552,8 @@ function get_forums(
INNER JOIN ".$table_item_property." item_properties
ON (
threads.thread_id=item_properties.ref AND
threads.c_id = item_properties.c_id AND
threads.session_id = item_properties.session_id
threads.c_id = item_properties.c_id
$sessionIdLink
)
WHERE
item_properties.visibility<>2 AND
Expand Down

0 comments on commit ce76804

Please sign in to comment.