41

The omniscient user 'community' made an edit to this answer (How to add a class to body tag?), and I am baffled to the reasoning behind it.

The original answer was:

You can extract that part of the url using a simple RegExp:

var url = location.href;
var className = url.match(/\w+\/(\w+)_/)[1];
$('body').addClass(className);

However it was edited by community to:

You can extract that part of the url using a simple RegExp:

var url = location.href;
var className = url.match(/\w+\/(\w+)_/)[1];
var url = window.href;
$('body').addClass('className');

Two things I can see wrong with this answer:

  1. Community added an unneccesary line (var url = window.href;)

This is just redefining url and is completely unnecessary.

  1. They added quotes around 'className'

className is a variable, and therefore when using jQuery to add this as a class to the body, quotes should not be used else the class of body will be set to, literally, the string "className" when what was wanted was the result of url.match(/\w+\/(\w+)_/)[1];

Edit

It seems that this edit was made my an anonymous user, approved by three (!) out of four SO users and thus this unconstructive, and outright harmful edit, was approved. My second question is, what can we do about these kind of mindless and harmful edits (and users)?


See the post, the answer, and its revisions.

8
  • 15
    Bad suggested-edits get approved quite often. This is an ongoing problem. Commented Aug 23, 2015 at 22:42
  • 5
    I've flagged the answer for moderator attention (linking the suggested edit and this meta post). They can take action against the reviewers. You might have done that as well, but bringing it up on meta is fine too.
    – Bergi
    Commented Aug 24, 2015 at 0:27
  • I think it's because it's a technical edit, i think reviewers are unlikely to read the question and answer so as long as it doesn't hard grammer or isn't obviously wrong it'll likely be approved
    – Aequitas
    Commented Aug 24, 2015 at 1:54
  • Ok thank you, luckily my edit to revert it has been accepted, however after one rejection that it shound be posted as a comment or an answer (?) But thank you for your input @Bergi
    – joe_young
    Commented Aug 24, 2015 at 8:59
  • 1
    I see you fixed it and the review reason you used was clear, but it can help to include links to meta questions like this when you or someone else have made a meta post about what you're editing, as it can be hard to explain concisely. Commented Aug 24, 2015 at 9:51
  • 7
    I was one of the reviewers who approved your suggestion. The original edit you were reverting was one of the most egregious examples of utter idiocy getting approved by reviewers I've ever seen. Thanks for fixing it. Patently stupid edit suggestions get approved all the time. (And good ones rejected, too. I'm sure you've noticed that even your obviously good edit - which you diligently submitted with an edit message explaining that it was rolling back a bad edit to stop us dumb reviewers from getting confused - still attracted one reject vote.) I'm afraid this won't be the last you see.
    – Mark Amery
    Commented Aug 25, 2015 at 10:45
  • Fair enough, sorry this was a while ago, forgot Matt had done those bans. Have edited them out, apologies @rene
    – joe_young
    Commented Jan 24, 2016 at 20:27
  • Ah, thank you very much for your time @MarkAmery
    – joe_young
    Commented Jan 24, 2016 at 23:42

1 Answer 1

40

Edits by "Community" are just edits made by an anonymous user. You can see this when you look at the suggested edit. Once the edit gets approved, it shows up as being done by community.

So the reason this edit was made was because an anonymous user decided to propose it, and 3/4 reviewers approved it.

16
  • 2
    Ah, right. But why was it approved? Am I right in thinking that the edit is incorrect?
    – joe_young
    Commented Aug 23, 2015 at 16:13
  • 4
    @joe_young I don't know enough about jQuery to know if the edit makes sense, but reviewers sometimes make mistakes, or just don't care very much. It's not unheard of for bad edits to be approved.
    – resueman
    Commented Aug 23, 2015 at 16:15
  • 4
    Okay, well the edit completely changes the code and makes it not work (t will run, without an error, but will not execute what is required). Thank you for your answer
    – joe_young
    Commented Aug 23, 2015 at 16:18
  • 2
    @joe_young, there are many users reviewing contents very fast without paying attention just to get more badges. That's why we have audits in the review queues: to force users to pay more attention and to ban the worst cases.
    – Zanon
    Commented Aug 24, 2015 at 9:23
  • 1
    @Qiu these stats are likely caused by this bug: meta.stackoverflow.com/questions/272597/…
    – vaultah
    Commented Aug 24, 2015 at 11:10
  • 39
    Can those approvers please be put on an edit ban for a little while? That edit should not have any approvals. I think it qualifies as vandalism. (I'm no jQuery expert either, but the change from a variable to a string of 'className' looks pretty obviously wrong.)
    – jpmc26
    Commented Aug 24, 2015 at 21:35
  • 11
    If a reviewer can’t decide whether a code edit is valid, (s)he should skip the audit rather than mindlessly approving it. It’s not like anyone was forced to decide between “reject” and “approve” only.
    – Holger
    Commented Aug 25, 2015 at 7:35
  • 18
    @jpmc26: rest assured that those reviewers will not be approving any suggested edits for a good while.
    – Matt Mod
    Commented Aug 25, 2015 at 9:17
  • Something needs to be done to discourage plain wrong or utterly useless edits, I believe. In the latter category: stackoverflow.com/posts/30314339/revisions Commented Aug 25, 2015 at 9:19
  • 1
    @Matt Thank you! It's appreciated.
    – jpmc26
    Commented Aug 25, 2015 at 13:12
  • 2
    <user>: has approved 965 edit suggestions and rejected 1 edit suggestion <user>: has approved 435 edit suggestions and rejected 0 edit suggestions It must be these users only review the "good" suggested edits. Where is that queue?
    – That1Guy
    Commented Aug 25, 2015 at 21:02
  • @ultrabowser. How did that person manage to put through an edit with no changes? Revision 3 apparently changes neither title, nor body, nor tags.
    – TRiG
    Commented Aug 26, 2015 at 11:25
  • 2
    @That1Guy I know it looks like this is not the case here but such numbers could easily be the result of someone only approving things they are absolutely sure of and skipping the rest.
    – musiKk
    Commented Aug 26, 2015 at 11:27
  • @That1Guy The stats may be a bit off. I for example have 1047 reviews in Suggested edits according to the badge tracker, still my stats seem to say 544 approved, 42 rejected. And I at least skip the ones I'm not sure about but I'm pretty sure I have rejected more. Commented Aug 26, 2015 at 12:14
  • @TRiG Maybe he made a change, and then quickly made another change undoing it. I think the edits would get merged into one.
    – resueman
    Commented Aug 26, 2015 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .