I had an issue with my pagination in AF. I have the topic lists saying I have 2 pages, but the topic saying I had 6, 10 replies showing on each page and the link to the last post was also wrong. Thread actually has 52 items including the original post.

Comment settings for the forum node set to 50 and that's what the AF code uses.

function advanced_forum_get_last_page($node) {
  $comments_per_page = _comment_get_display_setting('comments_per_page', $node);
  $comment_count = $node->comment_count;
  $last_page = ceil($comment_count / $comments_per_page) - 1;
  return $last_page;
}

However, the topic display is using the nodecomment view, which is set to 10 items.

The quick fix for users is to make sure comment settings for the node (10, 30, 50, 70...) and the items per page in the default nodecomment view are the same. That gets everything working; the topic list page info, the topic node pager, replies per post and the last post link.

The full solution is to change the function above to get $comments_per_page from the nodecomment view if the nodecomment module is being used. Also worth looking at includes/advanced_forum_preprocess_comment.inc as similar code there.

I checked -dev and it's not fixed in there and couldn't find any related issues, so I think it's a new fault.

Comments

michelle’s picture

Category: bug » feature

Seems like this is easily fixed by setting the comment settings correctly and more user error than bug. That said, it wouldn't be unreasonable for AF to peek at NC's view settings if it's not too hard to do. Leaving this active for now but may be won't fix'd if it turns out to be complicated.