Wedge

Public area => The Pub => Features => Topic started by: Arantor on February 12th, 2012, 05:40 PM

Title: Disallowing edits to posts
Post by: Arantor on February 12th, 2012, 05:40 PM
Well, more than once Nao and I talked about logging the user id of the person who edits a post. Maybe we can use that to prune some of the data from the table, maybe we won't do that yet, don't know. (It's not a huge deal if we decide to do that, put it that way.)

But what this does mean is that we can identify who last edited a post, and more importantly, we can figure out if either the last editor is the post author or not, or even if the last editor is actually a moderator.

This means we can (quickly but maybe slightly inaccurately, or slower but guaranteed accurate) identify whether the post was edited by a moderator and potentially disallow future edits to that post, by non moderators.

Would you use such a feature? Would you want it enabled by default (that if a post is edited by someone other than the author, only a moderator can edit it further)? Something further?
Title: Re: Disallowing edits to posts
Post by: Dr. Deejay on February 12th, 2012, 05:52 PM
I think it's a good idea and I would definitely use it. I don't know about enabling it by default, but I would definitely use it :)
Title: Re: Disallowing edits to posts
Post by: Dragooon on February 12th, 2012, 07:00 PM
I like it. Expanding upon the said idea, I've always wanted a hierarchy type system. So that a low life cannot overwrite the actions of a admin or higher moderator.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 12th, 2012, 07:13 PM
Well, that part is sort of the idea, though I'm not sure what else you'd need to do (since locks are also similarly covered; there is an internal difference between a non-moderator locking their own topic and a moderator lock, and the non mod cannot override the mod lock)
Title: Re: Disallowing edits to posts
Post by: Dragooon on February 12th, 2012, 07:17 PM
Quote from Arantor on February 12th, 2012, 07:13 PM
Well, that part is sort of the idea, though I'm not sure what else you'd need to do (since locks are also similarly covered; there is an internal difference between a non-moderator locking their own topic and a moderator lock, and the non mod cannot override the mod lock)
But a mod can overwrite a global moderator's lock, can't they?
Title: Re: Disallowing edits to posts
Post by: Arantor on February 12th, 2012, 07:22 PM
Quote
But a mod can overwrite a global moderator's lock, can't they?
True enough. However, I don't want to get into that debate because you risk having to cope with not 3 states (unlocked, soft lock, hard lock) but 5 (unlocked, user lock, mod lock, global mod lock, admin lock) and you can just bet some people will want even more complex solutions where they have staff who are in group x but not group y etc... far better to keep it simple.

Also, I'm not convinced that for something like lock or pin that you need to apply a technical/logistical solution for what is ultimately a non-technical problem - if you have a moderator who keeps screwing around, remove them from being a moderator.
Title: Re: Disallowing edits to posts
Post by: Dragooon on February 12th, 2012, 07:25 PM
Quote from Arantor on February 12th, 2012, 07:22 PM
Quote
But a mod can overwrite a global moderator's lock, can't they?
True enough. However, I don't want to get into that debate because you risk having to cope with not 3 states (unlocked, soft lock, hard lock) but 5 (unlocked, user lock, mod lock, global mod lock, admin lock) and you can just bet some people will want even more complex solutions where they have staff who are in group x but not group y etc... far better to keep it simple.

Also, I'm not convinced that for something like lock or pin that you need to apply a technical/logistical solution for what is ultimately a non-technical problem - if you have a moderator who keeps screwing around, remove them from being a moderator.
Fair enough.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 12th, 2012, 07:27 PM
Don't get me wrong, I can see situations where it would be useful, I'm just not convinced that the 'out of the box' experience with Wedge needs that, but I'm keen to avoid implementing technical solutions when there are more effective people solutions.
Title: Re: Disallowing edits to posts
Post by: billy2 on February 12th, 2012, 09:34 PM
As far as I am concerned no one but the author, mods or admins should be able to edit  a post.
On forums where anyone can edit posts, all I can see are flame wars and derogatory comments arising.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 12th, 2012, 09:41 PM
That isn't in dispute, and normal permissions can cope with that. This suggestion is primarily for the case where a moderator edits a post and the author edits it back.
Title: Re: Disallowing edits to posts
Post by: live627 on February 12th, 2012, 10:27 PM
What about giving the mod the choice when they ed it a post if  they want to luck it from future author edits instead/in addition to it being  a  global admin setting?
Title: Re: Disallowing edits to posts
Post by: Arantor on February 12th, 2012, 10:45 PM
Interesting idea, though it means another column we would only use very occasionally.
Title: Re: Disallowing edits to posts
Post by: billy2 on February 12th, 2012, 11:15 PM
Quote from Arantor on February 12th, 2012, 09:41 PM
That isn't in dispute, and normal permissions can cope with that. This suggestion is primarily for the case where a moderator edits a post and the author edits it back.
Sorry, totally misread your OP
Title: Re: Disallowing edits to posts
Post by: Nao on February 12th, 2012, 11:59 PM
Maybe this kind of 'post can't be edited by author' thing should be part of a future 'data' field.
Other elements that could be part of it (i.e. anything that's not searchable, but only used when showing the post):
- modified_time
- modified_name
- smileys_enabled?
- poster_email?
- subject??? (maybe not -- topic-wide renames, etc.)

That's still quite a lot of data that could be moved there.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 12:13 AM
Subject, no, but the others could be I guess.

But I don't see that as a 'right now' thing, though certainly now would be the sort of time if it were going to happen.
Title: Re: Disallowing edits to posts
Post by: Dismal Shadow on February 13th, 2012, 02:08 AM
I would disable it by default because personal I don't like who edited it...especially mods or admins.

It it related to: http://wedge.org/code/6690/to-edit-or-not-to-edit/ ?
Sorry the link is private.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 02:17 AM
Sort of, although you completely missed the post of what I was asking :/

Whether we display who edited something is absolutely irrelevant at this point in time. Right now, the fact is that we now actually track *who* edited it, rather than just the name of the editor.

The point I was getting at here is that if a moderator edits someone's post, should we prevent the person whose post it is from being able to edit it back?
Posted: February 13th, 2012, 02:14 AM

Essentially it is implementing http://wedge.org/pub/feats/6966/storing-the-modified-post-user-id/
Title: Re: Disallowing edits to posts
Post by: Dismal Shadow on February 13th, 2012, 02:26 AM
Got it. Well, if the post was edited my the moderator, it shouldn't be edited because it was edited for a reason other than abusing it.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 02:28 AM
That's exactly my thinking - and now we can actively offer the choice to block it. So... if that were an option, would you enable it? Would you prefer it to be default?

(The whole matter of the linked thread, of whether it should be displayed or not, that's another matter entirely but I have some ideas on that too.)
Title: Re: Disallowing edits to posts
Post by: Dismal Shadow on February 13th, 2012, 02:38 AM
It it can be edited if it was first enabled, then I see no reason why it shouldn't be enable by default.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 02:44 AM
...this is a totally new feature that doesn't yet exist in Wedge, not something that just needs enabling.
Title: Re: Disallowing edits to posts
Post by: Farjo on February 13th, 2012, 03:31 AM
Quote from live627 on February 12th, 2012, 10:27 PM
What about giving the mod the choice when they ed it a post if  they want to luck it from future author edits instead/in addition to it being  a  global admin setting?
I agree with this. We edit posts for two reasons - the first as you describe but the second and more common is to lend a hand e.g. to correct a link, to help show an image etc, and under this second circumstance we would not want the OP to be prevented from making edits to the rest of the post.

As for making it default - if the Mod has live627's choice I would make it the default, but otherwise I think you will get too many "bug" reports stating their members cannot edit posts any more ::)
Quote from Arantor on February 12th, 2012, 07:27 PM
I'm keen to avoid implementing technical solutions when there are more effective people solutions.
Is that the case here? Can admods just say "don't edit that again or you're banned / put into a group that cannot edit"?



(ps I really like the fact you can easily add quotes from two different posts :) )
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 09:20 AM
Quote
Is that the case here? Can admods just say "don't edit that again or you're banned / put into a group that cannot edit"?
It might be, you know. I wasn't sure so I figured I'd ask the question in case some folks wanted to make it happen.

I'm now seeing more of a balanced approach being required, so perhaps this should be left alone for a while and turned into a plugin rather than a core feature (and if people like it, we can make it core)
Title: Re: Disallowing edits to posts
Post by: Nao on February 13th, 2012, 10:55 AM
I can imagine that this is a bit frustrating -- if anything, adding a flag for "can edit" isn't really linked to knowing whether an admin edited the post -- e.g. they can simply not edit a post but prevent someone from editing their post, so that makes the storing of editor IDs a bit less useful than if an admin editing a post would block it automatically. If you know what I mean.
Posted: February 13th, 2012, 10:54 AM
Quote from Arantor on February 13th, 2012, 12:13 AM
Subject, no, but the others could be I guess.

But I don't see that as a 'right now' thing, though certainly now would be the sort of time if it were going to happen.
It's not like the messages table has too many fields, like the members table that really, really needed a data field (even though we're not using it much for now... I think?), but it can be seen as betting on the future, especially for plugins. :)
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 10:58 AM
I agree that a data field is necessary but care *must* be taken about what goes in it. Modifier name/poster name for example shouldn't, because if the related account gets deleted, bad stuff is going to happen because there's no way to update it easily in MySQL (as it doesn't have any notion of serialize)
Title: Re: Disallowing edits to posts
Post by: Nao on February 13th, 2012, 11:36 AM
That's why I didn't suggest moving modified_member over there, but I think modified_name could go, because, technically, we're never updating the name as it's being changed/deleted... Are we?
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 11:39 AM
Quote
but I think modified_name could go, because, technically, we're never updating the name as it's being changed/deleted... Are we?
We're not currently, but if we drop the modified_name as standard and rely on the modified_member only, then replace it if the account is deleted, then we'd *have* to update it.
Title: Re: Disallowing edits to posts
Post by: Nao on February 13th, 2012, 11:43 AM
Suggesting to simply check for modified_member when deleting a member, and if found, unserialize data and serialize with last known member name.

Although I'd rather we store the actual username as modified_name in data, instead of real_name (display name), and we put the priority on showing the (display) name as found through modified_member. Then if modified_member is associated to no name, we can use modified_name in its place.
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 11:55 AM
Quote
Suggesting to simply check for modified_member when deleting a member, and if found, unserialize data and serialize with last known member name.
Which still means doing it every row, as opposed to UPDATE wedge_messages SET modified_name = 'name' WHERE modified_member = id...
Title: Re: Disallowing edits to posts
Post by: TE on February 13th, 2012, 04:59 PM
Quote from Arantor on February 13th, 2012, 02:28 AM
if that were an option, would you enable it? Would you prefer it to be default?
I would enable it :)
Title: Re: Disallowing edits to posts
Post by: Nao on February 13th, 2012, 05:54 PM
Quote from Arantor on February 13th, 2012, 11:55 AM
Quote
Suggesting to simply check for modified_member when deleting a member, and if found, unserialize data and serialize with last known member name.
Which still means doing it every row, as opposed to UPDATE wedge_messages SET modified_name = 'name' WHERE modified_member = id...
Well... The question would be, would someone who edited a LOT of posts, be likely to be removing their account later...? Plus, it's only done once per account removal... i.e. not exactly common business...
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 06:03 PM
Therein lies the thing... it only requires said person to have edited 2 posts and already it's slower by a significant margin (since it's one big query and then one query per row minimum, versus one query to just deal with it)

It might not be done very often but if it were done that way I could see it causing big problems with prolific users who did this, like timeouts and white screens and database inconsistencies.
Title: Re: Disallowing edits to posts
Post by: Nao on February 13th, 2012, 06:35 PM
I don't see how the DB would be inconsistent if every single query dealt with member_id_whatever and the member name data var at the same time...
Oh well, anyway :)
Title: Re: Disallowing edits to posts
Post by: Arantor on February 13th, 2012, 09:18 PM
That's the point. If you have to do it row by row, you absolutely must be done inside one page load, or schedule it across page loads, but you have to be much, much more careful than the alternative.

If you can do it in a single query, the query runs atomically and doesn't affect anything else, but if you do it row by row, you have to do it row by row and be sure to be finished before actually deleting the member row.
Title: Re: Disallowing edits to posts
Post by: Nao on February 14th, 2012, 12:09 AM
Or we could just store somewhere a list of lost ids along with corresponding member name. If member not found, retrieve name from list...
Title: Re: Disallowing edits to posts
Post by: Arantor on February 14th, 2012, 12:12 AM
I think that's creeping into the realms of over-engineering the solution to something. When you have to keep track of whether you actually made your own changes because of the complexity of making changes, it seems like it's a step too far down a murky road.

The simplest solution, technically, would be to handle it as a transaction but they're not supported on MyISAM and that's almost creating another problem in its own right.
Title: Re: Disallowing edits to posts
Post by: Nao on February 14th, 2012, 12:37 AM
You want to know my solution?

No mem name.
Last edited by (account deleted)

Who cares, after all?
Title: Re: Disallowing edits to posts
Post by: Arantor on February 14th, 2012, 12:39 AM
In that case, guess I need to make sure the list of member ids who've edited a post is pushed into the posters query and drop the column.

Mind you, it's going to make imported entries very messy >_<
Title: Re: Disallowing edits to posts
Post by: Nao on February 14th, 2012, 07:12 AM
Why?
Title: Re: Disallowing edits to posts
Post by: Arantor on February 14th, 2012, 08:22 AM
Because imported entries won't have the id, only a name, so every edited post will be last edited by (deleted) even if the user is very much not deleted.
Title: Re: Disallowing edits to posts
Post by: TE on February 14th, 2012, 08:35 AM
unless the display name wasn't changed we could pick up the member's id within the import process.(one extra sql query per row in wedge_messages)

Would slow down the import, but shouldn't be a problem at all..
Title: Re: Disallowing edits to posts
Post by: Nao on February 14th, 2012, 08:38 AM
+1!
Title: Re: Disallowing edits to posts
Post by: Arantor on February 14th, 2012, 08:44 AM
That assumes the display name hasn't changed though...