Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#23876 closed defect (bug) (fixed)

Embedding mp3 breaks TinyMCE

Reported by: ericlewis's profile ericlewis Owned by: nacin's profile nacin
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.4
Component: TinyMCE Keywords: has-patch commit
Focuses: Cc:

Description

Add a simple mp3 embed tag to a page in the Text (HTML) mode. Switch to the Visual mode, and you won't be able to get back to the Text mode.

<embed src="example.mp3" width="640" height="480">

The resulting JS error blames the TinyMCE:

Uncaught TypeError: Cannot read property '0' of undefined in editor_plugin_src.js:480

Attachments (3)

23876.diff (927 bytes) - added by wonderboymusic 11 years ago.
23876.2.diff (1.3 KB) - added by SergeyBiryukov 11 years ago.
23876-3.patch (698 bytes) - added by azaozz 11 years ago.

Download all attachments as: .zip

Change History (9)

#1 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.6

This seems like a major problem especially given new stuff in 3.6.

#2 @wonderboymusic
11 years ago

  • Keywords has-patch commit added

#3 @SergeyBiryukov
11 years ago

23876.diff works, but I get this when switching to Text mode:

<object width="640" height="480" classid="clsid:undefined"><param name="src" value="example.mp3" /><embed width="640" height="480" src="example.mp3" /></object>

23876.2.diff removes classid="clsid:undefined".

#4 @nacin
11 years ago

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

In 23895:

Prevent a JS error when working with embedded media in TinyMCE.

props wonderboymusic. fixes #23876.

#5 @nacin
11 years ago

In 23896:

Prevent classid="clsid:undefined". props SergeyBiryukov. see #23876.

@azaozz
11 years ago

#6 @azaozz
11 years ago

  • Cc spocke added

Looked at that too, it's more complex than just fixing the error. The MCE media plugin shouldn't wrap a simple <embed> tag in an <object>.

Looks like it gets the internal 'type' wrong (as it looks at the mp3 extension) and assumes it's an <audio> tag rather than <embed>. 23876-3.patch fixes that (and doesn't require the other fixes) but needs more testing.

Note: See TracTickets for help on using tickets.