A JS TypeError is thrown when uploading files via the media browser.

Steps to reproduce:
* In a field that has a WYSIWYG launch the media browser
* Upload a new file
* Click submit
* At this point you should see the following error in the console:

TypeError: this.contentWindow.Drupal.media.browser is undefined
http://yourhost/sites/all/modules/media/js/media.popups.js?v=7.x-2.x
Line 105

* Clicking save still inserts the file correctly.

It seems like this can be fixed by changing line 103:
if (this.contentWindow.Drupal.media.browser == undefined) return;

See attached patch

CommentFileSizeAuthor
media_type_error_fix.diff598 bytesarthurf
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Elijah Lynn’s picture

Status: Needs review » Reviewed & tested by the community

This does make the error not appear anymore, I cannot speak for the technicality of this though.

ParisLiakos’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.