mirror of https://github.com/BOINC/boinc.git
Drupal: Fixed display bug in forum topics with no replies
If using newest post first sort order, topics with no replies would show no content due to faulty page count logic; page count was being calculated as zero when it should always be one at a minimum https://dev.gridrepublic.org/browse/DBOINCP-239
This commit is contained in:
parent
2e91088ef2
commit
b2bf23569a
|
@ -381,7 +381,7 @@ function boinc_preprocess_node_forum(&$vars, $hook) {
|
|||
$vars['node']->comment = 0;
|
||||
|
||||
$vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1));
|
||||
$page_count = ceil($vars['comment_count'] / $comments_per_page);
|
||||
$page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1);
|
||||
$vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue