Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Elmacik on September 04, 2015, 03:04:43 AM

Title: Deleting user deletes recycled topics
Post by: Elmacik on September 04, 2015, 03:04:43 AM
Version 2.0.10

Brand new installation, no mods, UTF-8, Turkish lang pack.

The steps;

1- You have a recycle board.
2- You delete a member, selecting "delete all topics and messages" without checking the box "delete this member", which first confirms with JS if you really want to delete that account.
3- Member is not deleted, but his/her topics and messages are moved to recycle board.
4- You go to delete the account again, this time checking the "delete this member" box now, and selecting "delete all topics and messages".
5- Recycled topics and messages are gone forever, which is not expected whereas they were already deleted. (Moved to recycle board.)

If this is intended, then it should delete all them at the first place rather than moving them into recycle board. And another problem here yet, topics and messages are deleted even if you don't confirm "are you really sure to delete" question.
Title: Re: Deleting user deletes recycled topics
Post by: margarett on September 04, 2015, 05:04:10 AM
I suggest it's not a bug, it's more like design
ProfileActions.php
// Only delete this poor members account if they are actually being booted out of camp.
if (isset($_POST['deleteAccount']))
deleteMembers($memID);


This only exists *after* the messages are already removed. So when you click the "Delete" button, you delete the messages as long as "Remove messages" is different from "None", no matter if "Delete this account" is checked or not.
The first time you delete the messages they go to recycle bin, next time they are gone forever (like any other post or topic ;) )
Title: Re: Deleting user deletes recycled topics
Post by: Elmacik on September 04, 2015, 07:46:55 AM
I guess that's right for deleting the topics and messages without deleting the member. But for the main issue; if deleting the topics from recycle board is by design, then it should delete at the first place, rather than moving into recycle board. Otherwise, it's conflicting with the logic of recycling system. Because in recycling system, messages are moved to a recycle board until you actaully go into that board and delete the message forever. Plus, if it's by design, then for the second time you take the same step, it should leave the messages intact in the recycle board, because they are already deleted. In the current design, some users' deletion will move their topics to recycle board, some other users' deletion will purge their topics forever.

To sum up; you repeat the same action for twice; but you get two different results, which is incorrect. If it's gonna stay this way, admin must be warned about it; since he won't know which message is going to be recycled and which will be purged. While I still think it's incorrect; because in programming, repeating the same step should always produce the same result.
Title: Re: Deleting user deletes recycled topics
Post by: Illori on September 04, 2015, 07:50:31 AM
i have not tested with 2.1 but i know once a topic/message hits the recycle board it requires clicking a specific link to delete it after that, maybe that should also apply to this?
Title: Re: Deleting user deletes recycled topics
Post by: Kindred on September 04, 2015, 07:52:08 AM
yes and no....


you do not have to go INTO the recycle board to permanently delete message which are already there.
In the user's profile, under posts by that user...   admins have the option to delete messages from that location. Selecting delete/remove message (if it is in the recycle board) WILL delete it permanently.

ANY delete action taken from the normal forum (e.g. messages not in the recycle board) will result in messages sent to the recycle board.
ANY delete action taken on message in the recycle board will result in a permanent delete... 

So, the activity seems to be correct, FAD... (and actually is logical)

(and no, Illori - it does not require a special link to delete a message in the recycle board, AFAIK -- nor should it.   This is exactly FAD.)
Title: Re: Deleting user deletes recycled topics
Post by: Oldiesmann on September 05, 2015, 02:04:23 PM
The layout of that page has been changed in 2.1 to make it slightly less confusing. Now you have three checkboxes - delete the member's poll votes, delete the member's posts (with the option to choose between "replies to topics" or "topics and posts") and delete the member's account. I haven't checked but I would assume it still deletes all of the member's posts regardless of where they're at. Maybe it should be changed to follow recycling (or with an added option for that) instead?
Title: Re: Deleting user deletes recycled topics
Post by: Illori on September 05, 2015, 03:44:51 PM
if you do that then you need to make sure the option only shows if there is a recycle board, also you would need to make sure that the old function deletes and bypasses the recycle board. it may cause some confusion though for those that have used the function before and the topics/posts ended up in the recycle board.
Title: Re: Deleting user deletes recycled topics
Post by: Kindred on September 05, 2015, 03:55:20 PM
Oldies -- unless you have changed the actual programming of the delete routine -- when you delete a user and opt to delete the messages and /or threads - I am pretty sure the deleted objects will go into the recycling board (if one is set up) AND that message currently IN the recycling board will get permanently deleted - exactly as it occurs right now.
Title: Re: Deleting user deletes recycled topics
Post by: Oldiesmann on September 08, 2015, 12:55:33 PM
If that's what it's doing, then that's horribly confusing. Either they should all stay in there or they should all get permanently deleted - not "if it's already in the recycling bin delete it otherwise move it there"...
Title: Re: Deleting user deletes recycled topics
Post by: margarett on September 08, 2015, 01:01:13 PM
IMO the "problem" is it allowing to delete the members' posts without actually deleting the users (eg: you uncheck the box again). I think it shouldn't allow that and the problem will fix itself (because looking at the code, it isn't that easy to create conditionals whether the posts are recycled or not just coming from the delete user interface).
Title: Re: Deleting user deletes recycled topics
Post by: Kindred on September 08, 2015, 01:35:25 PM
oldies....   you think that is confusing?  it seems logical to me. :)
Title: Re: Deleting user deletes recycled topics
Post by: margarett on September 08, 2015, 01:41:28 PM
Quote from: Kindred on September 05, 2015, 03:55:20 PM
Oldies -- unless you have changed the actual programming of the delete routine -- when you delete a user and opt to delete the messages and /or threads - I am pretty sure the deleted objects will go into the recycling board (if one is set up) AND that message currently IN the recycling board will get permanently deleted - exactly as it occurs right now.
It is logical, but maybe not desirable... The "issue" is that everything uses removeTopics/removeMessage and the behavior is: move to recycle bin, delete permanently if there already.
And what's pointed is that user posts already in the recycle bin shouldn't be removed when deleting the user, which will currently happen ;)
Title: Re: Deleting user deletes recycled topics
Post by: Oldiesmann on September 08, 2015, 01:57:39 PM
Quote from: margarett on September 08, 2015, 01:01:13 PM
IMO the "problem" is it allowing to delete the members' posts without actually deleting the users (eg: you uncheck the box again). I think it shouldn't allow that and the problem will fix itself (because looking at the code, it isn't that easy to create conditionals whether the posts are recycled or not just coming from the delete user interface).

I don't see this as a problem at all. Some people may want to just delete all the users' posts without deleting their accounts. Currently there is no option to determine whether or not to delete stuff that's already recycled, but it wouldn't be hard to add that at all.

Quote from: Kindred on September 08, 2015, 01:35:25 PM
oldies....   you think that is confusing?  it seems logical to me. :)

I understand why the function works that way (99% of the time all the topics we delete will be in the same board), but it doesn't make sense in this situation.
Title: Re: Deleting user deletes recycled topics
Post by: Oldiesmann on September 08, 2015, 02:26:17 PM
https://github.com/SimpleMachines/SMF2.1/pull/3038
Title: Re: Deleting user deletes recycled topics
Post by: Elmacik on September 10, 2015, 12:51:32 PM
Quote from: Oldiesmann on September 08, 2015, 12:55:33 PM
If that's what it's doing, then that's horribly confusing. Either they should all stay in there or they should all get permanently deleted - not "if it's already in the recycling bin delete it otherwise move it there"...

Agreed. It's horribly confusing because admin will never be sure which messages will be gone forever. It's not logical for two reasons;

1- Repeating the same steps should always produce the same results, while it doesn't now.
2- Conflicting with "recycle board" system, because if a message is recycled, it should stay there until the admin wants to purge.
Title: Re: Deleting user deletes recycled topics
Post by: Oldiesmann on September 10, 2015, 01:20:22 PM
I'll go ahead and merge in my changes then. It will add an extra checkbox to the delete account page allowing you to choose whether to permanently delete topics/posts. If checked, everything gets deleted regardless of where it is. If unchecked, anything not in the recycling board gets recycled while anything already in that board gets left alone. That should be more in line with what people want.