Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ParisLiakos’s picture

Any error in the javascript console when you click the button?

mtnguru’s picture

I don't get anything when I press Submit from both the Firebug console and the Firefox Javascript console (Ctrl Shift K).

I'm thinking the error is the Contextual links module in combination with another module. I'm going to re-enable Contextual Links and try disabling all other possible modules and see if I can identify a second module.

mtnguru’s picture

I've made some progress.

First, the Submit button always works if I don't select media, I get the message "You have not submitted anything".

If I am using the default Media Browser, and I disable either the DHTML or the Contextual Links module, the Submit button works ok.

If I clone the Media Browser View and have two media browser views or if I disable the default Media Browser and just have my cloned Media Browser, then the Submit button does not work. I've tried disabling every module possible and the submit button still does not work.

So I tried editing the default Media Browser View. I deleted the Filename Filter, still ok. I added a entity reference relationship to a content type, still ok. Then I created a filter using the title from that relationship - the submit button quit working. So I reverted the View and did exactly the same thing, added a filter to the entity reference -- Now the submit button works ok.

Anyone have ideas on what I can pursue? I have xdebug working and can step through the code but would like an idea where to look.

ParisLiakos’s picture

which theme you use? i am trying with seven right now and chrome and cant trigger this. if you use a non-standard theme, can you check with seven?

mtnguru’s picture

I started with AT Responsive Corolla, then tried Bartik, and Garland. They all had the problem.

mtnguru’s picture

Status: Postponed (maintainer needs more info) » Active

I spent the last 3 hours trying different combinations of modules. I found two more modules that are affecting the Submit button in the Media Browser View.

DHTML_menu is the worst, it causes the Submit button to fail in the default Media Browser View.

If I add to the image File Type, an Entity Reference to an article. Then add in the Media Browser View a relationship to that entitity reference, and then add a filter to the title of the related article entity reference - I find 4 modules that cause the Submit button to fail.

  • Administration Development Tools
  • Contextual Links
  • Media_youtube
  • Devel

If I disable any one of these four modules and leave the other three enabled then the Submit button works ok. I can even have two Media Browser Views defined and the Submit button still works.

So the easy solution for me is to disable the Administration Development Tools module (not sure when I enabled it or why) and the DHTML_menu module.

mtnguru’s picture

Status: Active » Closed (fixed)
kclarkson’s picture

Status: Closed (fixed) » Active

I wouldn't consider this fixed. Many of us need those modules working and still be able to use the media views selector :)

Update: I have tried disabling al of the mentioned modules and I still cannot get the save button to work. Tried multiple themes bartik, seven and rubik

Devin Carlson’s picture

Status: Active » Postponed (maintainer needs more info)

@kclarkson the media browser relies on JavaScript so any JS errors will prevent the browser from working. Have you checked your JS console log to ensure that your themes/modules aren't causing any errors?

kclarkson’s picture

Status: Active » Postponed (maintainer needs more info)

@Devin Carlson,

Unfortunately I never figured out what was causing my errors.

I updated Core, updated all Media modules to most recent dev and updated the Rubik admin theme to the most recent dev version and cleared my cache.

I also updated my MAMP's php.ini file to increase the amount of memory. I thought that I had fixed this but found out that I needed to update my .bash_profie file in my home folder with the following so that it pointed to the correct php.ini export "PATH=/Applications/MAMP/bin/php/php5.3.6/bin:$PATH"

Good luck to anyone else who finds this issue.

smerth’s picture

I would like to confirm this issue. I am unable to select any media files from the media browser view in the pop-up... I have turned off all the modules cited above and removed all JS from my theme, I have switched to bartik on the front end and tried seven on the backend.

I have tried chrome, firefox and safari...

Unable to select a media file...

smerth’s picture

Since clicking on a file doesn't select it. I thought adding a VBO field to the browser view would be way to select a file to act upon... however, the view-mode "media-browser" is hard coded....

apmsooner’s picture

Same problem. Images can be selected just fine. Selecting a document however gives me the error described above.

Looking at Firebug on the browse files popup, the html looks different on a document vs. image. On an image, there is just one outer link that contains <div class="media-item">

On a document however, there are 2 additional links. One is within <div class="media-item"> and one is within <div class="media-thumbnail">.

That doesn't seem right to me.... perhaps the duplicate links are causing issues?

apmsooner’s picture

Priority: Normal » Critical

Marking this as critical as files of document type simply cannot be selected through the media browser and submitted. Uploading new files as a workaround would just create duplicates of files that already exist.

apmsooner’s picture

Status: Postponed (maintainer needs more info) » Needs review

I've provided more info... I installed same versions on another site and the problem is easily reproduced. I've narrowed it down to document type of item in the browser. Images work fine... I can't find errors however. I'm hoping someone can figure this one out.

doktorrr’s picture

I have same on my website. "select media" button just don't work.

doktorrr’s picture

anybody have a solution for this issue?

ParisLiakos’s picture

Status: Needs review » Active

i see no patch
btw..there is either a js error, or the js events are not binded..can someone check if the submit button or the form all together has any event binded on it?

Bensbury’s picture

I had/have a problem very similar to this in that media won't submit, and media youtube on submission freezes and doesn't complete.

The difference was that it was working fine on our dev site which is almost identical.

I managed to get it a youtube video to embed, but switching off secure pages, embedded the video and then turned it back on again afterwards.
Not a solution, just got the video to work.

So possibly there is something happening related to https or something?
If I find out anything more will come back here, if it is related to other people's issues.
Are we seeing this problem on secure sites or everywhere?

Bensbury’s picture

We found the following causing the problem:

media.popups.js.

Drupal.media.popups.mediaBrowser.mediaBrowserOnLoad = function (e) {
  var options = e.data;
  if (this.contentWindow.Drupal.media.browser.selectedMedia.length > 0) { 
    var ok = $(this).dialog('option', 'buttons')['OK'];
    ok.call(this);
    return;
 }
};

This is because the page is https but the ajax call goes to http://www.example.jp/en/media/browser?render=media-popup&types... etc

Which causes this error:
Unsafe JavaScript attempt to access frame with URL http://www.cblh.jp/en/media/browser?render= ---- from frame with URL https://www.blah.jp/en/node/add/news. The frame requesting access has a protocol of 'https', the frame being accessed has a protocol of 'http'. Protocols must match.

If the page is https, Media tries to call the overlays on non-https and it screws up.
We fixed it by making the node edit pages non-https in secure pages.

However perhaps this is a module bug, where the overlay should be aware whether the base url is 'http' or 'https' and matches the url accordingly?

arthurf’s picture

Can people who are having this issue confirm that https is enabled on their site?

apmsooner’s picture

No, its not an https issue (at least wasn't for me). Its file type of "document". I fixed my issue by specifing different view mode for document in preview. I believe large filetype icon....

DamienMcKenna’s picture

apmsooner’s picture

I believe it might be related however, i never installed any patches. I just changed the preview mode on documents to large file-type icon and that resolved it for me.

arthurf’s picture

If changing the preview mode is fixing this issue for people, it is likely that DamienMcKenna is right that #1743040: "You have not selected anything!" error message, when a selection has clearly been made is probably the same issue. We may want to close this issue as a duplicate of that.

dap3065’s picture

Is there still no solution for the "select media" button not working?

arthurf’s picture

The fix was committed for http://drupal.org/node/1743040 see: http://drupalcode.org/project/media.git/commitdiff/e771336e3eab2389316d2...

Can you verify if you're still having the issue?

heylookalive’s picture

As per #20 for me this was down to secure pages messing with things, have set secure pages to ignore the media browser url "media/browser".

arthurf’s picture

Status: Active » Closed (fixed)

I'm marking this as fixed, please reopen if there are anymore issues.

lukus’s picture

Status: Closed (fixed) » Active

Changing the error status to active.

I'm receiving the same error - and believe that it's being caused by a mix of secure and insecure content ... an https url is being used for main admin pages, and http is being used for the content served by the media module's file dialog. This is causing my javascript console to complain:

jquery.js:5541
Unsafe JavaScript attempt to access frame with URL http://www.example.com/media/browser?render=…rces&file_extensions=pdf&max_filesize=&uri_scheme=public&plugins=undefined from frame with URL https://www.example.com/node/add/resource. The frame requesting access has a protocol of 'https', the frame being accessed has a protocol of 'http'. Protocols must match.

This results in an inability to select any files in the library browser. I'll report back when I find out more.

Dave Reid’s picture

Status: Active » Closed (fixed)

Please file a new bug report for your specific bug.

lukus’s picture

@Dave Reid

I believe this is the same issue. #20 and #28 raise the same concern.

Are you certain I need to open a new issue? Happy to do so if required.

lukus’s picture

@Dave Reid

I believe this is the same issue. #20 and #28 raise the same concern.

Are you certain I need to open a new issue? Happy to do so if required.

arthurf’s picture

@lukus - your post in #30 I think means that we are not rendering the iframe with the correct protocol. I think this thread has been a mix of two different issues, one of which has been solved. Would you mind opening a new issue specifically for the https issue?

alphex’s picture

I can confirm this is still not working.

But I'm in version = "7.x-1.3"

When I click on the submit button, I get a whole bunch of javascript errors.

here's what I'm clicking on screenshot : http://alphex.com/z/media_submit_broke-20130506-170541.jpg

here's the JS errors in chrome : http://alphex.com/z/js_errors-20130506-170701.jpg

Any fixes to this... (The cancel button, of course works... )

linyusos’s picture

Version: 7.x-2.x-dev » 7.x-1.3
Component: Media Browser » WYSIWYG integration

i got exactly bug with alphex

alphex’s picture

This has to do with the CKEDITOR module.

I just downgraded from the latest release of CKEDITOR 1.13, to 1.12, and it solved my problem.

I'll go comment on that project issue queue...

septianw’s picture

Status: Closed (fixed) » Active
FileSize
152.23 KB
147.67 KB

i don't know if it's still the same issue or different. i use media version 7.x-1.3 and wysiwyg 7.x-2.x-dev after i set the file type as seen from http://drupal.org/files/file-type-wysiwyg-media-error.png i cant press the submit button for that image as seen from http://drupal.org/files/media-wysiwyg-error.png

Please inform me if i need to open new issue.

septianw’s picture

Status: Active » Closed (fixed)
mortona2k’s picture

I had this problem when inserting images that had existed on the site before media. I fixed it by running the "Rebuild type information for media" at http://infocamp.dev/admin/config/media/rebuild_types

janis_lv’s picture

I'm getting these in console: "Uncaught TypeError: Object #<Object> has no method 'propAttr' "

will try to disable dhtml and context. brb

rootwork’s picture

Just FYI if you do still get errors, re-open this issue since right now it's closed and people might not see it.

Sabareesh’s picture

Status: Closed (fixed) » Needs work

Still could see "Object [object Object] has no method 'propAttr'" when clicking add select media. Version : 7.x.1.3

aaron’s picture

Status: Needs work » Closed (fixed)

This issue has nothing to do with either of the original reported issues in this ticket. Please open a new issue so that we can work on it without having to dig through unrelated problems.

aaron’s picture

Issue summary: View changes

Just a few grammar changes

jsheffers’s picture

Component: WYSIWYG integration » Code
Issue summary: View changes

#20 did the trick for me.

Bagz’s picture

Had this issue with a fresh install. My version of CKEditor is 4.1.1 and I was getting TypeError: c is undefined in ckeditor.js, Line 319. After a bit of googling I found this:
"In CKEditor 4.1 or higher you need to disable ACF in the config.js file", i.e. in the CKEditor configuration add this line to the configuration for your profile (under Advanced Options, in the box "Custom JavaScript configuration"):
config.allowedContent=true;

You'll probably need to add this to the configuration of each of the profiles that allow media.

WillowDigit’s picture

I have the exact same issue with Media 7.x-2.x. on a brand new install of Drupal 7.26. I can submit audio and video files from the media browser only in a view mode where the file display is set as generic file. And when I switch over to jQuery 1.10 (still with the file display set to generic file) the button does not work at all.

Anonymous’s picture

FYI: jquery update crashes WYSIWYG module. Disabling jquery update may be a good option for some.

duppy.ocio’s picture

Thank you. It worked after i disabled Jquery update.

Zythyr’s picture

I had the same issue, but to fix the problem, I changed the Default jQuery Version to 1.5 by going to Home » Administration » Configuration » Development » jQuery update

I am running:
D7
Media 7.x-2.x
Ckeditor module

ideogram_nl’s picture

Commenting on @Zythyr: one can set a different version of jQuery for content-pages and admin-pages. If you don't mind editing nodes in the admin theme, you could use this to set jQuery to 1.5 for admin pages and 1.10 for regular pages.

stinky’s picture

Just updated to Media 7.x-2.0-alpha4+24-dev and the Submit button does not work.
Jquery is disabled.
Any ideas on how to get this working?

Arne Slabbinck’s picture

Arne Slabbinck’s picture

duppy.ocio’s picture

Enabling both Image and Media on wyswyg profiles did the trick :)

dawid_nawrot’s picture

Yep, I can confirm what duppy.ocio said. Enabling both image button and media button solves the problem.
Thanks

loopy1492’s picture

Switching to an earlier version of jQuery in my Administration theme did the trick. I switched to 1.7. YMMV.

/admin/config/development/jquery_update