[RSS Feed/News] N+1 query behaviour in What's New profile posts with banned users

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
Hidden behind a redirect is a bunch of N+1 query behaviour from the view check, if a number of profile posts exist on a banned user

ProfileUser.Ban needs to be loaded to check if the user is permanently banned. If so, then the user profile is hidden from the result set.

Should add a with statement;
PHP:

Code:
protected function applyFilters(XF\Finder\ProfilePost $profilePostFinder, array $filters)
{
   $profilePostFinder->with('ProfileUser.Ban');
....

And/or then update...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom