Page MenuHomePhabricator

[betalabs] Uncaught TypeError: Cannot read property 'nextSibling' of null - when Reply to WikiLove
Open, Needs TriagePublic

Description

Steps to reproduce:

  1. On betalabs, enable WikiLove (Special:Preferenes-Editing).
  2. Post WikiLove message on a user page. The WikiLove messages will have a reply link:

  1. Click on the reply link - the link disappear and no text box is open. The Console will display the following error:
Uncaught TypeError: Cannot read property 'nextSibling' of null
at Object.addListItem
at CommentController.js.CommentController.setup 
at CommentController.js.CommentController.onReplyLinkClick
at HTMLAnchorElement.dispatch
at HTMLAnchorElement.elemData.handle

and the warning

jQuery.Deferred exception: Cannot read property 'nodeType' of null TypeError: Cannot read property 'nodeType' of null

Example page: https://en.wikipedia.beta.wmflabs.org/wiki/User_talk:ET10#A_kitten_for_you!

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 22 2020, 10:25 PM
matmarex added a subscriber: matmarex.

Seems to be a problem with server-side reply links; there is a marker for the start of the comment (e.g. <span data-mw-comment-start="c|ET13|2020-10-22T22:11:00.000Z|A_kitten_for_you!_2"></span>), but a matching marker for the end (data-mw-comment-end) is nowhere to be found. So we get a null and these exceptions.

Okay, I see what is happening… We insert the end marker inside the <br style="clear: both;"/> node, which is of course impossible in HTML. Oof…

matmarex updated the task description. (Show Details)Oct 23 2020, 1:04 AM
matmarex updated the task description. (Show Details)