Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Yağız... on November 17, 2009, 01:05:33 PM

Title: [4000] reattributePosts function does not update topic counts
Post by: Yağız... on November 17, 2009, 01:05:33 PM
As title says. I tried to reattribute, on a fresh install, Simple Machines' posts to my account, it didn't updated the topic count.
Title: Re: reattributePosts function does not update topic counts
Post by: Arantor on November 17, 2009, 03:25:32 PM
What topic count, exactly?

What version of SMF?
Title: Re: reattributePosts function does not update topic counts
Post by: Yağız... on November 17, 2009, 03:38:28 PM
SMF 2.0 RC2
Before reattributing:
(http://i50.tinypic.com/30vf2h4.png)
After reattributing:
(http://i46.tinypic.com/2ytzgh0.png)
Title: Re: reattributePosts function does not update topic counts
Post by: Arantor on November 17, 2009, 03:42:39 PM
Then you've reattributed more too; there's only one post that gets made normally.

As for topic count, I'm not convinced that's a bug actually, because it would never have counted to start with. Remember; that test post doesn't have an original user id to tie back to.

Thing to test it: create a test user, get that account to make a post, then delete the user; then create a new user and reattribute it.
Title: Re: reattributePosts function does not update topic counts
Post by: Yağız... on November 17, 2009, 03:44:24 PM
Quote from: Arantor on November 17, 2009, 03:42:39 PM
Then you've reattributed more too; there's only one post that gets made normally.

As for topic count, I'm not convinced that's a bug actually, because it would never have counted to start with. Remember; that test post doesn't have an original user id to tie back to.

Thing to test it: create a test user, get that account to make a post, then delete the user; then create a new user and reattribute it.
I already did this, as you can see in the pictures :)
Title: Re: reattributePosts function does not update topic counts
Post by: Arantor on November 17, 2009, 03:46:11 PM
But are these posts in new topics, or just reattributing from existing topics?

I don't think it's checked for performance reasons, and I believe standard advice is to ask the forum maintenance to recalculate anyway after reattribution.
Title: Re: reattributePosts function does not update topic counts
Post by: Yağız... on November 17, 2009, 03:52:11 PM
There are just "new topics" on my test forum, not a reply at all :)

I tried "Recount all forum totals and statistics" but it didn't work. Maybe there is no code for updating topics in AdminBoardRecount, in ManageMaintenance.php file?
Title: Re: reattributePosts function does not update topic counts
Post by: Arantor on November 17, 2009, 03:54:20 PM
Ah, wait a minute.

Can you check the topics table to see if id_member_started is the right user id for your 'admin' user?
Title: Re: reattributePosts function does not update topic counts
Post by: Yağız... on November 17, 2009, 03:58:37 PM
No, they are not :)
(http://i48.tinypic.com/2ed9zck.png)
Title: Re: reattributePosts function does not update topic counts
Post by: Arantor on November 17, 2009, 04:04:07 PM
Well, that's where the bug is, id_member_started isn't being updated if the topic is the first post or the last post in the topic.

I'm not sure we should expect users to have to run Find & Repair (which should fix this)

Reported - Bug #4000: Reattributed posts do not update topics table (http://dev.simplemachines.org/mantis/view.php?id=4000)