Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threads table empty data and update_first_post() #3148

Closed
euantorano opened this issue Apr 22, 2018 · 0 comments
Closed

Threads table empty data and update_first_post() #3148

euantorano opened this issue Apr 22, 2018 · 0 comments
Assignees
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Milestone

Comments

@euantorano
Copy link
Member

I've been experiencing intermittent threads which do not have a username in forumdisplay but when you view the thread it has the data.  I looked into this and it appears to have started in MyBB 1.8x only since none of the problems threads were previous to my upgrade.

mybb_threads table has a firspost entry but the UID, USERNAME, and DATELINE are either empty or set 0.  

I found about 111 threads in the past 5 months with uid=0 and dateline=0.  Today I was trying to fix them all with a while query to populate the data from post table using the firstpost pid.  While doing so I found out that the function update_first_post() exists in inc/functions. So basically I just had to do the query for "uid=0 AND dateline=0" and then run update_first_post($results['tid']) to populate the data. Worked perfectly.

So I looked into what triggers the update_first_post() action and inside showthread.php is this:

PHP Code:if($mybb->input['action'] == "thread"){ if($thread['firstpost'] == 0) { update_first_post($tid); } 

If this can be changed to

PHP Code:if($mybb->input['action'] == "thread"){ if($thread['firstpost'] == 0 || $thread['dateline'] == 0) { update_first_post($tid); } 

It would pretty much fix this bug.  I can't be sure if the thread entries are a bug strictly for my site due to lag, plugins, or attacks but I do know this code change could fix it and also help anyone who may have this issue.

Can I suggest everyone who has a reasonable size forum please run this query to check if you have any of these bad threads?

Code:SELECT * FROM mybb_threads WHERE uid = 0 AND dateline = 0 ORDER BY tid ASC

So this is part bug report and part suggestion to fix potential problems.

Thanks.

Original thread: Threads table empty data and update_first_post()

@euantorano euantorano added b:1.8 Branch: 1.8.x t:bug Type: Bug. An issue causing error / flaw / malfunction s:confirmed Status: Confirmed. Retested and found the issue exists labels Apr 22, 2018
@Sama34 Sama34 self-assigned this Apr 22, 2018
@Sama34 Sama34 added this to the 1.8.16 milestone Apr 22, 2018
@effone effone added s:resolved Status: Resolved. Solution implemented or scheduled and removed s:confirmed Status: Confirmed. Retested and found the issue exists labels Apr 30, 2018
Eldenroot pushed a commit to Eldenroot/mybb that referenced this issue May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x s:resolved Status: Resolved. Solution implemented or scheduled t:bug Type: Bug. An issue causing error / flaw / malfunction
Projects
None yet
Development

No branches or pull requests

3 participants