9
  1. Ask a question;
  2. Click Answer your own question
  3. Check community wiki
  4. A dialog box

    Are you sure you want to make this post Community Wiki?

    will appear, Click OK or Cancel;

  5. The same dialog will appear again.

Google Chrome 44.0.2403.107 / Windows8.1 / site rev 2015.7.25.3609

6
  • Can you please unaccept the answer? Know it's weird to ask, but in Meta for a bug report, accepted answer should be a developer who actually fix the bug, or explain why it can't be fixed etc. Having it accepted might cause the team to ignore the bug report Commented Dec 2, 2015 at 8:26
  • @ShadowWizard Oops, I've just unaccepted it. Thank you for letting me know.
    – unarist
    Commented Dec 2, 2015 at 8:35
  • No problem, hopefully devs will see this soon and fix. :-) Commented Dec 2, 2015 at 8:38
  • @ShadowWizard I was a bit worried as well so I asked Oded about how answering would affect bug visibility for the team.
    – rene
    Commented Dec 22, 2015 at 11:29
  • @rene but the point here was that the answer was accepted, so common sense tells that it means the bug was handled. As it stands, it doesn't matter - this is just one another bug in the 6000-8000 bugs list that will be fixed in 6-8 years. (or not :)) Commented Dec 22, 2015 at 11:46
  • Sure, good call @ShadowWizard
    – rene
    Commented Dec 22, 2015 at 12:11

1 Answer 1

9

That seems to be a bug in wmd.js

This line is wiring the click event to be only called one single time:

$(".js-post-editor input[type=checkbox][name=communitymode]").one("click", function () {
    return confirm(function (e) {
        return "Are you sure you want to make this post Community Wiki?" + e.blankLine + "Doing so will remove explicit ownership and you will no longer earn reputation for upvotes on it. Once saved, this option cannot be unchecked without moderator assistance."
    }
        ({
            "blankLine" : "\n\n"
        }))
})

The jquery selector is .js-post-editor input[type=checkbox][name=communitymode]

When the page https://meta.stackexchange.com/questions/ask is served it already contains the answer box with the checkbox but is hidden:

<input id="communitymode-42" name="communitymode" type="checkbox" >

The WMD editor is however started twice, once for the question and once for the answer:

    function createEditor() {
        prepareEditor({
            heartbeatType: '',
            bindNavPrevention: true,
            postfix: "-42", // for the question this is a ""
                onDemand: false,
                discardSelector: ".discard-question"
            ,postId:42
            });

As the jquery selector for the checkbox doesn't take the postfix into account, it wires the click event two times, hence the confirmation box showing twice.

I think if the jquery selector in 02_EditorInitialization.js is changed to

 // community wiki can accidentally be enabled - inform users of this nuclear option
 $('#communitymode' + options.postfix).one('click', function () {  

it should work as designed.

Expect 6 to 8 units to get this patch pushed.

0

You must log in to answer this question.

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