WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 months ago

#47706 closed defect (bug) (fixed)

Typo in comments reply observer, new comments don't get events attached

Reported by: maguiar Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version: 5.1
Component: Comments Keywords: has-patch needs-testing
Focuses: javascript Cc:
PR Number:

Description

There's a typo in the comment's reply link observer. It's supposed to observe DOM changes inside body so it can attach the reply link event to new nodes. However, Core has it written as:

var observerOptions = {
    childList: true,
    subTree: true
};

subTree should be subtree. Because of this new comments added with ajax don't get the event attached to them, and the reply link directs instead to whatever the reply link points to. While the rest of comments open the reply form below the comment.

Attachments (1)

47706.diff (417 bytes) - added by maguiar 5 months ago.
Typo fix

Download all attachments as: .zip

Change History (5)

@maguiar
5 months ago

Typo fix

#2 @maguiar
5 months ago

  • Keywords has-patch needs-testing added

#3 @SergeyBiryukov
5 months ago

  • Milestone changed from Awaiting Review to 5.3
  • Version changed from trunk to 5.1

Hi @maguiar, welcome to WordPress Trac! Thanks for the ticket and the patch.

Introduced in [44748].

#4 @SergeyBiryukov
5 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45641:

Comments: Fix typo in comment reply observer options.

Props maguiar.
Fixes #47706. See #46260.

Note: See TracTickets for help on using tickets.