I've been working with 4.7 for a while now and noted that my forum posts/messages counts were both 0 and the last post column showed something like a week ago, though I had posts and had posted recently.

Anyway, I installed beta 6 and created a fresh database. At first it looked to be fine. I entered a post, the stats incremented to 1 and the last post date was right (though I didn't do another test after that). Today, after I upgraded Mysql from 5.0.1 to the latest 5.0.18 the counts & date column are once again not updating after entering posts. I can't see why upgrading the database version would affect this.

Comments

cagg’s picture

Title: forum statistics not updating » forum "last post" column show oldest, not most recent

well, after some further testing involving creating some posts, the count would only update every 2nd entry or the count would skip one. However after I started deleting posts to check the count decreases I eventually got an db error "Incorrect key file for table './drupal/node.MYI'; try to repair it" so it appears my node table was corrupted. I did REPAIR TABLE and now the count appears to be updating.

However I did note that the "last post" column is showing the oldest post not the most recent as I would expect

thinkling’s picture

I'd like to confirm this bug.

I'm seeing the post count increment correctly, but the "last post" column sticks to the first post made in the forum and does not update.

I'm running a fresh install of 4.7b6 on PHP 4.4.x, MySQL 4.0.23.

Zen’s picture

Assigned: Unassigned » Zen
Status: Active » Needs review
StatusFileSize
new1.84 KB

Patch attached:

-solves the last post issue.
-removes unnecessary cruft from the query.
-also removes the pointless if statement at the top of the function.

This function is only called once - by forum_page.

Cheers,
-K

Zen’s picture

StatusFileSize
new1.85 KB

Just checked with Cvbge and pgSQL requires the != 0 in the IF.

updated.

-K

dan_aka_jack’s picture

StatusFileSize
new1.86 KB

I found that this patch output the name of the person who created the node, instead of the name of the user who submitted the last post. I've tinkered and I found that altering this section:

INNER JOIN {users} u ON n.uid = u.uid

to this:

INNER JOIN {users} u ON ncs.last_comment_uid = u.uid 

Fixes the problem.

Thanks,
Jack

Zen’s picture

StatusFileSize
new1.9 KB

One of the JOINs from the original query that I removed needs to be back. Patch attached. I think I was testing this against the wrong page :S

Thanks Dan/Jack.
-K

Zen’s picture

Status: Needs review » Reviewed & tested by the community
killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed

applied

Zen’s picture

Status: Fixed » Closed (fixed)