Hi,

I just upgraded a large forum (close to a million posts) from D6 to D7 with Advanced Forum. I am running into a weird issue where the pager's last page is wrong in very long threads with thousands of comments (*not* using comment node). For example, on one thread the last page the pager lets me click to is listed as "117" in the pager, with a URL of /node/40642?page=116 , but the last comment on that page is not really the last comment in the thread. However, if I manually change the URL to node/40642?page=117 the pager still shows "117" but it now shows the actual last posts in the thread.

This issue only occurs for me when using the administrator user 1 account. I assume it has something to do with the paginator code being written for normal users that can't see unpublished posts, whereas I as user 1 can see unpublished posts.

Thanks in advance for looking into this.

Comments

sb56637 created an issue. See original summary.

rahim123’s picture

Issue summary: View changes
rahim123’s picture

Title: On long threads Advanced Forum pager last page missing for admin user 1 » Advanced Forum pager last page missing for admin user 1 when unpublished comments exist
rahim123’s picture

Issue summary: View changes
Michelle’s picture

Priority: Major » Normal

This sounds really familiar to me. Have you checked the queue as well as the core forum queue? Also, have you checked if this is a problem with AF disabled so you're just using core forum? I have a vague memory of seeing something related to pagination and access control months ago but can't remember specifics and don't have the time to search right this moment.

rahim123’s picture

Hi Michelle, thanks a lot for taking the time to reply. Yes, I have scoured the issue queue and can't find anything directly related. And I did try disabling AF, and the pagination works correctly for the core forums. I did find an issue related to node access control, but I didn't think it was related because I'm not running any kind of special access control modules.

I also confirmed that the issue is definitely related to the unpublished comments in some threads, because I can reproduce the issue with a non-admin user (not user 1) that has "view unpublished comments" permission.

rahim123’s picture

Title: Advanced Forum pager last page missing for admin user 1 when unpublished comments exist » Advanced Forum pager last page missing when unpublished comments exist in thread
JordanMagnuson’s picture

Confirming that this is still an issue.

JordanMagnuson’s picture

Version: 7.x-2.6 » 7.x-2.x-dev

Confirming that this is still an issue in 7.x-2.8 and dev.

JordanMagnuson’s picture

Confirming that when Advanced Forum module is disabled, the comment pager is shown correctly both to users who have "view unpublished content" and those that do not. E.g. more pages are shown to users who can view unpublished content, if the forum topic node has unplublished comments.

When enabling the Advanced Froum module, the same number of pages are shown regardless of whether user has "view unplublished content" permission, which means that if the forum post has unpublished comments, the pager may be missing pages at the end.

Seems like a strange bug, since as far as I can tell the Advanced Forum module seems to be using Drupal's built-in pager functionality?

JordanMagnuson’s picture

Willing to give bounty for a fix.