Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#19165 closed defect (bug) (fixed)

TinyMCE throws error on mousedown (error in wpEditImage)

Reported by: joehoyle's profile joehoyle Owned by: azaozz's profile azaozz
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.3
Component: TinyMCE Keywords: has-patch
Focuses: Cc:


In trunk, a JS error in thrown in your mousedown on an element that is not an image and has no child elements.

This is due to the wpEditImage mousedown handler:

if ( && ( == 'IMG' || == 'IMG') ) {

Steps to reproduce:

  1. Create a new post, paste the folling into the HTML view
    <input type="text" value="foo" />
  1. Switch to Visual, click on the input

Observed Result:
JS Error "Uncaught TypeError: Cannot read property 'nodeName' of null"

Attached patch to fix

Attachments (1)

19165.diff (677 bytes) - added by joehoyle 12 years ago.

Download all attachments as: .zip

Change History (3)

12 years ago

#1 @ocean90
12 years ago

  • Milestone changed from Awaiting Review to 3.3
  • Owner set to azaozz
  • Status changed from new to reviewing

Related: r18702

#2 @azaozz
12 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In [19180]:

Fix js error on mousedown in the editor, props joehoyle, fixes #19165

Note: See TracTickets for help on using tickets.