Advertisement:

Author Topic: [4000] reattributePosts function does not update topic counts  (Read 3687 times)

Offline Yağız...

  • SMF Super Hero
  • *******
  • Posts: 10,811
  • Gender: Male
    • MMO Browser
[4000] reattributePosts function does not update topic counts
« 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.
« Last Edit: November 17, 2009, 04:04:23 PM by Arantor »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,401
    • StoryBB/StoryBB on GitHub
Re: reattributePosts function does not update topic counts
« Reply #1 on: November 17, 2009, 03:25:32 PM »
What topic count, exactly?

What version of SMF?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Yağız...

  • SMF Super Hero
  • *******
  • Posts: 10,811
  • Gender: Male
    • MMO Browser
Re: reattributePosts function does not update topic counts
« Reply #2 on: November 17, 2009, 03:38:28 PM »
SMF 2.0 RC2
Before reattributing:

After reattributing:

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,401
    • StoryBB/StoryBB on GitHub
Re: reattributePosts function does not update topic counts
« Reply #3 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Yağız...

  • SMF Super Hero
  • *******
  • Posts: 10,811
  • Gender: Male
    • MMO Browser
Re: reattributePosts function does not update topic counts
« Reply #4 on: November 17, 2009, 03:44:24 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 :)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,401
    • StoryBB/StoryBB on GitHub
Re: reattributePosts function does not update topic counts
« Reply #5 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Yağız...

  • SMF Super Hero
  • *******
  • Posts: 10,811
  • Gender: Male
    • MMO Browser
Re: reattributePosts function does not update topic counts
« Reply #6 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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,401
    • StoryBB/StoryBB on GitHub
Re: reattributePosts function does not update topic counts
« Reply #7 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?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Yağız...

  • SMF Super Hero
  • *******
  • Posts: 10,811
  • Gender: Male
    • MMO Browser
Re: reattributePosts function does not update topic counts
« Reply #8 on: November 17, 2009, 03:58:37 PM »
No, they are not :)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,401
    • StoryBB/StoryBB on GitHub
Re: reattributePosts function does not update topic counts
« Reply #9 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
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.