Mediabrowser is not closing after clicking cancel button.

This is from the console log: is undefined (media.popups.js Line 103)

Simple change seems to solve the problem.

#13 Screenshot_2_10_13_3_49_PM.jpg708.24 KBgmclelland
#8 Selection_055.png78.36 KBgirishmuraly
#7 close_popup-1409068-7.patch627 bytesgirishmuraly
PASSED: [[SimpleTest]]: [MySQL] 56 pass(es).
[ View ]
popup.patch593 bytesolemsa
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch popup.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]


dddave’s picture

Status:Active» Postponed (maintainer needs more info)

I am not able to reproduce this error and it seems that you are the only person reporting such issues. Can you recheck with the latest dev and provide more infos if the problem persists?

Devin Carlson’s picture

Status:Postponed (maintainer needs more info)» Closed (cannot reproduce)

I haven't been able to duplicate this with the latest stable or development release of Media.

SocialNicheGuru’s picture

delete - it's not the same issue. similar but not quite

other similar issue:

SocialNicheGuru’s picture

Status:Closed (cannot reproduce)» Active

Ok. I now that I solved one issue another pops up.

The modal popup does not close with a "this.contentWindow.Drupal is undefined"
i have a form opening in ctools_automodal and the media field is being called from the form in that modal.
so this might be an issue of a popup within a popup

mauritsl’s picture

This issue also mentions a problem with the popup:

girishmuraly’s picture

The fix mentioned in #0 works for me when applied manually to 2.0-unstable7.

girishmuraly’s picture

Status:Active» Needs review
new627 bytes
PASSED: [[SimpleTest]]: [MySQL] 56 pass(es).
[ View ]

Rerolling patch for latest 2.x-dev.

girishmuraly’s picture

new78.36 KB

Since #1 and #2 mentioned they could not reproduce this, I'm attaching a screenshot of what does not work. The above patch fixes this.

gmclelland’s picture

I haven't experienced this yet. Can someone list the steps to reproduce on a clean install? Maybe something is conflicting with with the Rubik theme, the js, or other modules on your site?

girishmuraly’s picture

It could be with the Rubik theme or another conflicting js, I'm not sure. I haven't tested this on the basic default theme.

However here are the steps to reproduce the problem in my case:

1. Add an image field to any content type with:
Field type: Image
Widget: Media file selector
2. In its field settings, tick 'Image' for 'Allowed remote media types' and set 'public://' as the Allowed URI scheme.
3. Go to the node/add page for this content type and add an image for this field.
4. Save the node.
5. Edit this node.
6. Try to edit the image you uploaded and add some data to it, such as Alt or Title or Description.
7. Hit Save.

Nothing happens for me when I hit Save. The window does not close and the data does not get saved. This is happening for me both on 2.x-dev and on 2.0-unstable7

arthurf’s picture

@girishmuraly can you duplicate this with a file field?

aaron’s picture

Status:Needs review» Postponed (maintainer needs more info)
gmclelland’s picture

Status:Postponed (maintainer needs more info)» Active
new708.24 KB

I just tested on a dev site with an image field and a file field and can confirm that this does happen for both cases.

Maybe we should bump this status to major?

See attached for a screenshot

Here is what the watchdog say's:

LOCATION http://site:8082/media/141/edit/ajax
REFERRER http://site:8082/node/151/edit

Warning: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: recursion detected in json_encode() (line 4985 of /Users/glenn/websites/7c9d097f-0bc1-457d-8314-1d9e37f102bf/includes/

I do not see any errors in the console.

I'm running locally on a Mac with Acquia Dev Desktop and using Seven as the admin theme.

gmclelland’s picture

FYI.. I just created a clean test site at with media-2.x-dev and I couldn't replicate the problem. If anybody has any ideas of what is causing the problem, I'm all ears.

gmclelland’s picture

gmclelland’s picture

If anyone is still having this issue with the latest dev version, please speak up. You can also try the patch at #1909408-17: ctools_modal_form_wrapper returns form array instead of ajax_commands array and see if that works.

I'm still not clear if this is the same issue as #1909408: ctools_modal_form_wrapper returns form array instead of ajax_commands array

ParisLiakos’s picture

Status:Active» Closed (cannot reproduce)

I commited the ctools patch, so if anyone steps on it in latest dev please, reopen

Honestly Illustrated’s picture

Version:7.x-2.x-dev» 7.x-1.x-dev
Status:Closed (cannot reproduce)» Active

Reopening this on the 7.x-1.x branch.

This issue still exists in 7.x-1.x-dev, where we create a content type as in this video.

Click "Select media" and get this in JS console:

[06:27:11.562] Use of getAttributeNode() is deprecated. Use getAttribute() instead. @ .../misc/jquery.js?v=1.4.4:55
[06:27:11.562] Use of attributes' specified attribute is deprecated. It always returns true. @ .../misc/jquery.js?v=1.4.4:56

Paste your YouTube URL and click "Submit" and get this:

[06:27:21.481] TypeError: this.contentWindow.Drupal is undefined @ .../sites/all/modules/media/js/media.popups.js?v=7.x-1.3+2-dev:103


We get no popup at all, after the media browser popup closes. JS calls out to Drupal, gets a reply:

[06:37:46.510] POST .../media/browser?render=media-popup&types=&activePlugins=&schemes%5Btwitch%5D=twitch&schemes%5Byoutube%5D=youtube&schemes%5Bpublic%5D=0&file_directory=&file_extensions=txt&max_filesize=&uri_scheme=public&plugins=undefined [HTTP/1.1 302 Found 789ms]
[06:37:47.290] GET .../media/browser?render=media-popup&fid=2 [HTTP/1.1 200 OK 312ms]

The grey screen overlay div.ui-widget-overlay remains z-indexed on top of the page. No popup regarding the HTTP response.

Honestly Illustrated’s picture

I was able to both stop and reproduce this bug. I found the root cause of my instance of the issue, but not a solution to the root cause of the bug itself.

My instance of it was in the fact that I had installed the 1.x version of Media, along with the 2.x versions of File Entity and Media: YouTube. (doh!)

However... we still have the bug occurring during error states of the module. Whatever the mismatched versions did to Media to cause an error, it seems that Media may have caught it or failed softly, but couldn't report anything through the popup code: the popup code has that separate unresolved bug.

Remember that the HTTP response code for the AJAX call was 200 OK.

ja09’s picture

Version:7.x-1.3» 7.x-1.x-dev

edit below.

ja09’s picture

Version:7.x-1.x-dev» 7.x-1.3

Popup won't close when using Remote stream wrapper 7.x-1.0-beta4 and entering the "Remote URL". Remote URL's are working, but the popup window just redirects to /admin/content when clicking Submit. Otherwise, it seems to work normally, and the Cancel button does close the window.

Are there any known conflicting modules/js?

ja09’s picture

Version:7.x-1.x-dev» 7.x-1.3

^ Nevermind, fixed my issue with this patch:

timodwhit’s picture

Issue summary:View changes

I was getting this issue as well, what ended up being the issue was actually conflicting file_entity modules.

Checkout your apache log to see if this error is occurring. It will appear as a javascript issue because the file is not being attached.