Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#27836 closed defect (bug) (fixed)

Uncaught TypeError in media-editor.js on edit.php screen

Reported by: helgatheviking's profile helgatheviking Owned by: markjaquith's profile markjaquith
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.9
Component: Posts, Post Types Keywords:
Focuses: javascript Cc:

Description

I'm seeing the following error in my console on the edit.php screen for all post types.

Uncaught TypeError: Cannot read property 'id' of undefined
media-editor.js?ver=3.9-RC2-src:538

Does this script even need to be loaded on this page?

Attachments (1)

27836.diff (451 bytes) - added by nacin 10 years ago.

Download all attachments as: .zip

Change History (11)

#1 @nacin
10 years ago

This script isn't loaded on this page. Plugin?

@nacin
10 years ago

#2 @nacin
10 years ago

  • Milestone changed from Awaiting Review to 3.9

Confirmed that

#3 @nacin
10 years ago

Confirmed that if the script is loaded on this page, it produces a type error that was not present in 3.8.

#4 @helgatheviking
10 years ago

Yes, my mistake, a plugin is loading the script. I don't think the plugin needs to be loading the media-editor script on this page, so I have reported the bug to the plugin developer.

Last edited 10 years ago by helgatheviking (previous) (diff)

#5 @nacin
10 years ago

Which plugin?

This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.


10 years ago

#7 @helgatheviking
10 years ago

Projects by Woothemes

#8 @markjaquith
10 years ago

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

In 28149:

Ensure that wp.media.view.settings.post is set before accessing the post's id

Avoids JS error in cases where media-editor is loaded individually
instead of with the whole wp_enqueue_media() process.

fixes #27836. props nacin

#9 @markjaquith
10 years ago

@helgatheviking — Thanks for catching this. Just in the nick of time for 3.9!

#10 @helgatheviking
10 years ago

Whoa! That seems like the fastest fix ever! Props.

Note: See TracTickets for help on using tickets.