Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#32870 closed defect (bug) (fixed)

commentReply is undefined in the editor screen

Reported by: clorith's profile Clorith Owned by:
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.3
Component: Editor Keywords:
Focuses: javascript Cc:

Description

When editing posts or pages you hit an error with commentReply being undefined halting all future js execution.

post.js:271 contains the code commentReply.close(); which halts execution and makes the "You are leaving this page" warning show up when saving draft and publishing posts and pages

Change History (4)

#1 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 4.3

Introduced in [33024]. I could not reproduce the error so far, are there any specific steps?

#2 @Clorith
10 years ago

It only kicks in on a new post or page, it could seems like the metabox the javascript function references isn't included in post_new.php, but it exists in post.php perhaps?

Editing an existing post or page will not lead to this behavior, nor will it happen again after saving as a draft or publishing once (so you need to click the "Leave this page" link once no matter what).

#3 @SergeyBiryukov
10 years ago

  • Keywords needs-patch good-first-bug added

Reproduced on Add New Post screen, edit-comments.js is not enqueued there.

We should just check if commentReply is set before calling commentReply.close().

#4 @obenland
10 years ago

  • Keywords needs-patch good-first-bug removed
  • Resolution set to fixed
  • Status changed from new to closed

Didn't see this ticket before fixing it. Thanks for the report!
Fixed in [33066].

Note: See TracTickets for help on using tickets.