Fixed ProfilePosts::actionComments loads all profile-posts to find the total

Xon

Well-known member
Affected version
2.1.1
In actionComments, all profile posts on a user are loaded when the code is just interested in the total

PHP:
$profilePosts = $profilePostFinder->where('post_date', '>', $profilePost->post_date)->fetch();

$page = floor($profilePosts->count() / $this->options()->messagesPerPage) + 1;

Shouldn't this just be ->total() to get the profile post count total?
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.2).

Change log:
In a couple of places, use a count/total query when calculating the correct page number for profile posts.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom