Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a content type video with a File field (field type "File" and Widget "Media file selector"). When I go to upload a video (Select media button), select the video or paste a YouTube video, and click Submit, I get the error:
TypeError: this.contentWindow.Drupal is undefined
if (this.contentWindow.Drupal.media.browser.selectedMedia.length > 0) {
Anybody have an idea how to fix this issue? Also, when I go to edit Content that is of type Video, it just shows a blank page. No idea what is going on.
Comment | File | Size | Author |
---|---|---|---|
#5 | type_error-1960438-4.patch | 2.14 KB | magi.yv |
Comments
Comment #1
First.Middle.Last.1024 CreditAttribution: First.Middle.Last.1024 commentedHere's what appears to happen:
I create a Content of type Video. It loads and then I hit "Select media". It opens a media popup, runs through media.popups.js fine. Once I paste in the YouTube URL and hit submit, the page reloads but on line 103 of media.popups.js,
this is: iframe#mediaBrowser.media-modal-frame
contentWindow is: Window browser?render=media-popup&fid=162
Drupal is: undefined
There is no popup window anymore but I do see the black overlay.
Comment #2
First.Middle.Last.1024 CreditAttribution: First.Middle.Last.1024 commentedAlso, if it is any help, when I first click on "Select media", the form action is:
/media/browser?render=media-popup&types%5Bimage%5D=image&types%5Bvideo%5D=video&activePlugins=&schemes%5Byoutube%5D=youtube&schemes%5Bpublic%5D=public&file_directory=videos&file_extensions=mv4+mp4+ogg+theora&max_filesize=&uri_scheme=public&plugins=undefined
Comment #3
blueyestar CreditAttribution: blueyestar commentedSimilar issue when I paste vimeo URL
Comment #4
magi.yv CreditAttribution: magi.yv at Zyxware Technologies commentedSimilar issue. When the pop-up loads getting error message
"TypeError: this.contentWindow.Drupal.media is undefined
if (this.contentWindow.Drupal.media.browser.selectedMedia.length > 0) { "
version : 7.x-1
Comment #5
magi.yv CreditAttribution: magi.yv at Zyxware Technologies commentedThis patch resolved my issue.
Comment #6
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedClosing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team
Comment #7
firewaller CreditAttribution: firewaller commentedJust for the record, this was happening for me after enabling Cloudflare CDN and I ended up fixing it by disabling the "Rocket Loader" feature.