Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Felix J on May 24, 2011, 12:19:51 PM

Title: [4730]Remove "Topics and Posts" doesn't work?
Post by: Felix J on May 24, 2011, 12:19:51 PM
Here is information about it - http://www.simplemachines.org/community/index.php?topic=434970.0

If any support specialist wanna take a look I can give you login info via pm.
Title: Re: Remove "Topics and Posts" doesn't work?
Post by: mashby on May 24, 2011, 05:27:14 PM
I'm game (as in curious). I'll await your PM and hope I can assist you.
Title: Re: Remove "Topics and Posts" doesn't work?
Post by: Felix J on May 26, 2011, 06:12:46 AM
I was feeling really sick yesterday so I had to sleep almost the whole day, but now it's better.

I've sent you the login information.

Thanks!
Title: Re: Remove "Topics and Posts" doesn't work?
Post by: Felix J on May 26, 2011, 08:16:16 AM
I don't know if this functon works when not connecting the posts to a new user and just deleting the topics and posts from the original user. Since I haven't tried this. Only tried it after connecting the topics and posts to a new user.
Title: Re: Remove "Topics and Posts" doesn't work?
Post by: emanuele on May 26, 2011, 11:29:02 AM
As far as I can see it's a bug.

SMF doesn't delete the topics reassigned to another used.

Reproduced in a freshly installed SMF 2.0 RC5.
The problem should be that the topics are not "reassigned" to the new user (id_member_started) and then when it's time delete them SMF fails because the id of the reassigned member is not the same as the id of the id_member_started now 0.

Edit
This query:
$smcFunc['db_query']('', '
UPDATE {db_prefix}topics as t, {db_prefix}messages as m
SET t.id_member_started = {int:memID}
WHERE m.id_member = {int:memID}
AND t.id_first_msg = m.id_msg',
array(
'memID' => $memID,
));


at the end of the function reattributePosts, just before the return should fix it. :) (don't have any idea how it works on big databases! ;))
Title: Re: Remove "Topics and Posts" doesn't work?
Post by: Felix J on May 26, 2011, 11:44:12 AM
Quote from: emanuele on May 26, 2011, 11:29:02 AM
As far as I can see it's a bug.

SMF doesn't delete the topics reassigned to another used.

Reproduced in a freshly installed SMF 2.0 RC5.
The problem should be that the topics are not "reassigned" to the new user (id_member_started) and then when it's time delete them SMF fails because the id of the reassigned member is not the same as the id of the id_member_started now 0.

OK!

Good to know. Thanks
Title: Re: Remove "Topics and Posts" doesn't work?
Post by: IchBin™ on May 26, 2011, 11:53:26 AM
In case you missed it Felix, emanuele updated his last post with a fix. Looks like you guys posted almost at the same time. :)
Title: Re: Remove "Topics and Posts" doesn't work?
Post by: Felix J on May 26, 2011, 12:07:52 PM
Quote from: IchBin™ on May 26, 2011, 11:53:26 AM
In case you missed it Felix, emanuele updated his last post with a fix. Looks like you guys posted almost at the same time. :)

Yes I saw it, but thanks anyway.



emanuele, so your fix covers both the options "All Posts" and "Topics and Posts" as well when topics or/and posts gets removed from the poster in which made the threads and posts?

(I don't know if the same issue comes after deleting threads and/or posts from the original poster...) so this would be good to know aswell..

Will it also be possible to just remove posts but not threads with this fix choosing the option "All Posts"?


Last but not least... lets say a user spam with just making threads... and you choose the option "All Posts". What will be happen then? Should the admin choosing the option get an message saying it isn't possible or something like that? Since that option should only remove posts and not threads?

Title: Re: [4730]Remove "Topics and Posts" doesn't work?
Post by: Felix J on May 26, 2011, 12:40:18 PM
Anyone that can say for sure if the feature option "All Posts" works? and if both the options would work for the original poster aswell. This is a little offtopic I know, but it's very close to this one.

Yes all posts works for the user connected to posts... I will check the other one.


Forget my earlier message.

OK everything else in this area seems to be working after testing. Great! Then only this one.
Title: Re: [4730]Remove "Topics and Posts" doesn't work?
Post by: emanuele on May 29, 2011, 04:05:41 AM
BTW, it's related to [4000] reattributePosts function does not update topic counts (http://www.simplemachines.org/community/index.php?topic=348671.0).

Issue marked (and closed) as duplicate.
Title: Re: [4730]Remove "Topics and Posts" doesn't work?
Post by: Illori on November 18, 2011, 09:08:43 AM
moving to bogus board as duplicate of the other thread