WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#19165 closed defect (bug) (fixed)

TinyMCE throws error on mousedown (error in wpEditImage)

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

Description

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 ( e.target && (e.target.nodeName == 'IMG' || e.target.firstChild.nodeName == '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 10 years ago.

Download all attachments as: .zip

Change History (3)

@joehoyle
10 years ago

#1 @ocean90
10 years ago

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

Related: r18702

#2 @azaozz
10 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.