“first unread post” bug

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
simonGA
Registered User
Posts: 14
Joined: Wed Jan 13, 2021 8:27 pm

“first unread post” bug

Post by simonGA »

Hi

There is a problem on my board where the “first unread post” button takes people to the page after where the last unread post actually is. This isn’t a feature I use, but others are hoping for a solution.

The bug seems to consistently occur when on day 1 there are less than ten posts, hence all on page 1. Then on day 2 there are more than 10 posts, so the topic has gone to page 2. The "first unread post" will take you to the top of page 2, thus skipping the last few posts on page 1. This only seems to happen when going from page 1 to page 2, and not with later pages.

Does anyone have any idea what could be causing this? I have a couple of extensions but none that should in theory relate to this functionality, and other than that it’s a vanilla install (3.3.2)…

Simon
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: “first unread post” bug

Post by Brf »

The only time I have ever seen anything like this is when a user has been deleted directly from the database, leaving their posts behind. Their posts are no-longer shown in the topic, but they are still counted when the pagination is computed.
simonGA
Registered User
Posts: 14
Joined: Wed Jan 13, 2021 8:27 pm

Re: “first unread post” bug

Post by simonGA »

Brf wrote: Wed May 26, 2021 1:39 pm The only time I have ever seen anything like this is when a user has been deleted directly from the database, leaving their posts behind. Their posts are no-longer shown in the topic, but they are still counted when the pagination is computed.
Thanks Brf. I’ve not made any changes to the database, and have only one disabled user … there were a couple of spam users when I had the default spam protection, but this is happening with new topics now.

Any suggestions for anything I could try?
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: “first unread post” bug

Post by stevemaury »

Run this SQL and report the results ( Executing SQL Queries in phpMyAdmin )

Code: Select all

SELECT poster_id FROM phpbb_posts WHERE poster_id NOT IN(SELECT user_id FROM phpbb_users WHERE user_type <> 2)
If your table prefix is not phpbb_ change it in the query accordingly.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
simonGA
Registered User
Posts: 14
Joined: Wed Jan 13, 2021 8:27 pm

Re: “first unread post” bug

Post by simonGA »

Thank you. That returned no results;

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0033 seconds.)

Is that expected?
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: “first unread post” bug

Post by stevemaury »

Well, it's good in that it indicates there are no posts by deleted users.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: “first unread post” bug

Post by Brf »

Your query includes inactivated users, which are user_type 1. I would think those would mess up pagination too.
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: “first unread post” bug

Post by stevemaury »

Yes, precisely. So they are not the issue either.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
simonGA
Registered User
Posts: 14
Joined: Wed Jan 13, 2021 8:27 pm

Re: “first unread post” bug

Post by simonGA »

Very strange. I’ve run the main purge jobs and I guess I could upgrade from 3.3.2 to 3.3.4, although I don’t see any relevant changes between the two. I could disable the extensions for a while, although some will have a bigger impact than the problem. Any idea if any of these are likely to be relevant?

Extension NameAdvanced BBCode Box
Current version 3.3.2
OptionsDetails
Actions Disable
Extension NameAuto Drafts
Current version 1.1.3
OptionsDetails
Actions Disable
Extension NameDark Mode
Current version 1.0.2
OptionsDetails
Actions Disable
Extension NameDigests
Current version 3.3.4
OptionsDetails
Actions Disable
Extension NameExternal Links Open in New Window
Current version 1.0.10
OptionsDetails
Actions Disable
Extension NameLarge Font
Current version 3.2.3
OptionsDetails
Actions Disable
Extension NameSearch user topics
Current version 1.0.5
OptionsDetails
Actions Disable
Extension NameVigLink
Current version 1.0.5
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: “first unread post” bug

Post by stevemaury »

Disable them all. If that fixes the issue, re-enable one at a time to find the culprit. If it doesn't, re-enable them all. They won't be down very long.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: “first unread post” bug

Post by Brf »

stevemaury wrote: Sat May 29, 2021 12:45 am Yes, precisely. So they are not the issue either.
My point was your "NOT IN" part is including user_type 1 also. You should also exclude the user_type 1 users

SELECT poster_id FROM phpbb_posts WHERE poster_id NOT IN(SELECT user_id FROM phpbb_users WHERE user_type = 0 or user_type = 3)
simonGA
Registered User
Posts: 14
Joined: Wed Jan 13, 2021 8:27 pm

Re: “first unread post” bug

Post by simonGA »

Brf wrote: Tue Jun 01, 2021 3:38 pm
stevemaury wrote: Sat May 29, 2021 12:45 am Yes, precisely. So they are not the issue either.
My point was your "NOT IN" part is including user_type 1 also. You should also exclude the user_type 1 users

SELECT poster_id FROM phpbb_posts WHERE poster_id NOT IN(SELECT user_id FROM phpbb_users WHERE user_type = 0 or user_type = 3)
Hi. This has brought up about 30 rows. Should I delete these from the database, or maybe better find all non active users and delete them in the PHPBB admin console?
User avatar
warmweer
Jr. Extension Validator
Posts: 11233
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: “first unread post” bug

Post by warmweer »

simonGA wrote: Thu Jun 10, 2021 8:09 pm Hi. This has brought up about 30 rows. Should I delete these from the database, or maybe better find all non active users and delete them in the PHPBB admin console?
Use the ACP, direct database editing should be kept to a minimum and only done by those who know exactly what they are doing and can repair any errors resulting from their action.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: “first unread post” bug

Post by Brf »

You should be able to pull up those users in Manage Users. Either delete the users and also delete their posts, or you can simply delete their posts in the Quick Tools.
simonGA
Registered User
Posts: 14
Joined: Wed Jan 13, 2021 8:27 pm

Re: “first unread post” bug

Post by simonGA »

Brf wrote: Thu Jun 10, 2021 8:21 pm You should be able to pull up those users in Manage Users. Either delete the users and also delete their posts, or you can simply delete their posts in the Quick Tools.
Hi

It’s definitely nothing to do with users. I have a very keen forum member some spare time, and he has proven that it’s a bug with the current release;
I installed phpBB (version 3.3.4) on my local network, did nothing but create a forum, and two users to test the bug, and the same bug happened.
So it does sound like it’s a bug?
Post Reply

Return to “[3.3.x] Support Forum”