42

At some point this afternoon the edit comment functionality was changed and now when you edit a comment you see [object Object] instead of the text. If I click edit here:

enter image description here

I see this:

enter image description here

This is happening on at least Database Administrators, Stack Overflow, and this site, so it is probably network-wide.

  • Go ahead, try it here. Add a comment, wait the requisite 5 seconds, then try to edit it. – Aaron Bertrand Aug 17 '18 at 19:08
  • 5
    [object Object] – Sonic the Masked Werehog Aug 17 '18 at 19:08
  • 3
    Reproduced here; moderators please see edit history of comment above. – Sonic the Masked Werehog Aug 17 '18 at 19:09
  • Ha. Same here on EL&U english.meta.stackexchange.com/questions/11620/… – Mari-Lou A Aug 17 '18 at 19:17
  • [object Object] That's bloody weird. – Rand al'Thor Aug 17 '18 at 19:27
  • 2
    Well, it’s easy to explain what went wrong: when editing a comment a string is expected as the current comment text, but whatever function handles comment edits receives an object (which may include the actual text) instead. The object is inserted as the value, thus automatically stringified, and by default you get [object Object]. This is most likely due to some change of the editing logic. – user289905 Aug 17 '18 at 19:31
  • Thread from Meta Stack Overflow – Jonathan Lam Aug 17 '18 at 19:36
  • [object Object] @SonictheInclusiveHedgehog that's actually pretty funny) A flashmob of [object Object] anyone? (Damn, I just had to say it!) – ivan_pozdeev Aug 17 '18 at 19:50
23

This is my fault, the fix is live now for MSE, building on the network.

In working on Keyboard-only users cannot flag comments in the new comment flag dialog, I needed access to the event that showed the flagging dialog, so I updated the comment UI hooks to pass in the event as the first parameter.

This was fine fo the various hooks, upvote, flag, etc, except for edit, because the edit hook already had a parameter defined textOverride. So the event that was passed in was treated as a text override and replaced the edit text.

| improve this answer | |
  • 4
    On the bright side, at least you were not getting [object Object] when editing this post :) – ivan_pozdeev Aug 17 '18 at 19:57

You must log in to answer this question.

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