Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#35363 closed defect (bug) (fixed)

Bug js when replacing a audio or video in post editor

Reported by: truonght's profile truonght Owned by: azaozz's profile azaozz
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: javascript Cc:

Description

When I replace a audio or video in editor, browser console show an error:

Uncaught TypeError: Cannot read property 'indexOf' of undefined
In file wp-includes/js/media-audiovideo.js?ver=4.4.1, line 801:

if ( this.model.get( 'src' ).indexOf( 'vimeo' ) > -1 && ! ( 'Froogaloop' in window ) )

I think we should check this.model.get( 'src' ) !== undefined

Attachments (1)

media-audiovideo.js (21.9 KB) - added by truonght 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
9 years ago

  • Focuses javascript added

#2 @azaozz
9 years ago

Confirmed. This is a bit "hacky" place to be checking the src but don't see a better one for now. It only prevents a preview to be shown in the modal, the video/audio is replaced properly in the editor.

#3 @azaozz
9 years ago

  • Milestone changed from Awaiting Review to 4.5

#4 @azaozz
9 years ago

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

In 36233:

Media: fix undefined error that prevents showing a preview in the media modal when replacing video or audio.

Fixes #35363.

Note: See TracTickets for help on using tickets.