I'm trying to use the Media Browser "View Library" tab on the "Select media" modal widget, and the submit button is not working. Every time I click, the modal redirects back to the homepage. The media is not added to the node. I have to refresh to get the modal to disappear, and afterward, due to the refresh, the media is still not present.
Steps to reproduce:
1. Click Select media.
2. Click to highlight a media object in the view.
3. Click Submit.
4. Redirects back to homepage.
At first I thought this was due to a conflict with my jQuery Update, which I hacked to use jQuery 1.7, for jQuery Mobile support, but I disabled jQuery Update, and the issue is still happening. I also cleared all caches, and am not using either JS or CSS aggregation.
I am using the Seven theme on the admin side, and a custom subtheme of AT Commerce (AdaptiveTheme subtheme) on the frontend, and am using the admin theme for content editing.
I can let you know modules & versions (as a txt attachment from drush) if that would be helpful.
Comment | File | Size | Author |
---|---|---|---|
#9 | select media error.png | 524.61 KB | rickvug |
Comments
Comment #1
EvanDonovan CreditAttribution: EvanDonovan commentedEven though #1319528: Media browser view library exposed form submit problem is for 2.x, and also mentioned specifically when a filter is added, it appears that it may be a related issue.
Comment #2
joshmillerI'm using 2.x and having the same issue. Frustrating because there is no way to connect a library item with a fieldable entity right now.
Comment #3
Dave ReidComment #4
Dave ReidHas anyone checked their browser's JavaScript console log for any errors when they submitted? I haven't been able to reproduce this yet on 2.x
Comment #5
Dave ReidMarked #1411418: Unable to select and insert image to a node using media file selector as a duplicate of this issue.
Comment #6
victoriachan CreditAttribution: victoriachan commentedHi,
This is the error I got on the JS Console,
using Media 2.0-unstable3 (and with Views 3.0). I clicked on 'Select Media' on my node edit page, and then clicked on 'View Library' and selected an image, and clicked 'Submit'. This error occurred when I clicked 'Submit' and redirected the page in the modal to the site's homepage.
Could this be related to Views? I noticed that on the Media project page, under requirements, it states: Views (7.x-2.x only). And I recall reading in one of the duplicate tickets relating to this that it was something to do with Views.
I have tried with Views 7.x-3.0 and 7.x-3.1, and both had the problem. What version of Views are you trying it with, Dave Reid?
I understand that Media explicitly states that it only supports up to Views 2.x only. But Views 7.x-2.x seems to be unavailable for download anymore though I have the impression that I was using Views 2.x before and have only recently upgraded to 3.x for a security fix. I think I'll raise a separate issue regarding that description on the projects page, as it could confuse people.
Meanwhile wonder if that's what's causing this problem?
Thanks very much,
Victoria
Comment #7
victoriachan CreditAttribution: victoriachan commentedOops sorry, I was being silly. Someone's pointed out to me that the statement, 'Views (7.x-2.x only)', meant that Views was required on Media 7.x-2.x only. :P
Comment #8
Fanaile CreditAttribution: Fanaile commentedI'm getting the same js error using File entity 7.x-2.0-unstable3, Media 7.x-2.0-unstable3 and Views 7x-3.1.
I also tried (just for curiosity's sake) to click on the "cancel" button, which does the same thing and creates the same js error as clicking on the submit button.
Line 103 of media.popups.js reads:
if (this.contentWindow.Drupal.media.browser.selectedMedia.length > 0) {
But, as this is the exact same as what was in 7.x-1.0-rc3 (which I was using prior successfully) I'm not sure that it's actually being caused by the js?
Comment #9
rickvug CreditAttribution: rickvug commentedIs the redirect happening within the modal or outside of the modal? Attached is a screenshot of the error that I've been periodically experiencing with Media for quite a while now. I think this is it.
Comment #10
victoriachan CreditAttribution: victoriachan commentedYes, that looks like it. It was happening inside the modal for me too.
Comment #11
gmclelland CreditAttribution: gmclelland commentedMaybe this is related http://drupal.org/node/1319528#comment-5605672 - try the ctools patch and see if it helps
Comment #12
ambientdrup CreditAttribution: ambientdrup commentedDid anyone get this to work? I'm also experiencing this same issue with the 3.x version of Views and the 7.x-2.0 version of Media.
-Trevor
Comment #13
gmclelland CreditAttribution: gmclelland commentedDid you try the ctools patch from http://drupal.org/node/1324238#comment-5360410? See if it helps you.
Comment #14
ambientdrup CreditAttribution: ambientdrup commentedHaven't tried the patch yet. It's on my list.
-Trevor
Comment #15
ambientdrup CreditAttribution: ambientdrup commentedOk I ran the patch and it seems to work. I can now select the View Library tab and then select an image and it inserts correctly.
So this looks like it works.
Now the question is how can we get that patch committed to CTools core? Is that possible?
-Trevor
Comment #16
gmclelland CreditAttribution: gmclelland commentedI think we need more people to test the ctools patch and see if it works for them. If it does work, I think we should report our results over to the ctools issue #1324238: Not all views exposed forms auto-submit correctly (was: Clean up and improve auto-submit.js0 so that it can be committed.
Comment #17
ambientdrup CreditAttribution: ambientdrup commentedOk cool. Let me know how I can help to keep this process moving along rapidly.
Thanks!
-Trevor
Comment #18
heshanlkcTools update didn't fix my issues and when I looked in to error console I can see
Comment #19
gmclelland CreditAttribution: gmclelland commentedFYI... the Ctools issue was committed #1324238: Not all views exposed forms auto-submit correctly (was: Clean up and improve auto-submit.js0
Comment #20
drumla CreditAttribution: drumla commentedI have the same problem: The Submit button redirects back to the homepage. The homepage is rendered inside the modal dialog box. The only way to close the modal box is to reload the page. No file gets selected into the content.
I'm using:
Drupal core 7.12, ctools 7.x-1.0-rc2, File entity 7.x-2.0-unstable3, Media 7.x-2.0-unstable3, Media: YouTube 7.x-1.0-beta3, Plupload integration 7.x-1.0-rc1 and Views 7.x-3.3.
If I'm understanding it right, the Ctools issue is fixed in ctools 7.x-1.0-rc2, but that does not help.
Has anyone made any progress in finding the source of this problem? If I can help by providing more information, please let me know.
- Stefan
Comment #21
vlajkop CreditAttribution: vlajkop commentedVictoria, Stefan, Fanaile,
Have you been able to solve this issue? If yes please explain how. I have absolutely same error reported in line 103 of media.popups.js?v=7.x...
Modules are same as you are using.
Comment #22
victoriachan CreditAttribution: victoriachan commentedHi,
Actually I have just tried this again yesterday, disabling the other modules one by one to see what was causing the problem on my site, since I couldn't replicate this problem on a clean build. Guess what I found out?
It was actually my browser cache all along.
Well I suppose there was that problem with ctools, but after upgrading ctools to latest, I was still having the problem.
I guess the problem was due to my browser caching the old JavaScript files from Media 1.x or the old Ctools even after I have upgraded them. As I was just testing on my local site, I didn't have 'Aggregate JavaScript files' turned on, and so clearing Drupal cache didn't do anything to clear the old JavaScript.
Hope this helps!
Victoria
Comment #23
victoriachan CreditAttribution: victoriachan commentedCan someone else confirm that this has been fixed for Media 2.x-dev / Media 2.0-unstable3 with the latest ctools (7.x-1.0) and views (7.x-3.3)?
If you are still having problems, try clearing your browser cache or test with a fresh browser.
If this is fixed, we can update the ticket status.
It works for me now with Media 2.0-unstable3, ctools (7.x-1.0) and views (7.x-3.3).
Cheers,
Victoria
Comment #24
vlajkop CreditAttribution: vlajkop commentedThanks for responding Victoria.
Everything seems to be ok with media module. Remotes stream wrapper module is one that I'm having issue with and its plug-in “Remote URL” that is causing same behavior as described here. Also with newest versions of this modules I'm not getting this plug-in “Remote URL” as option displayed.
Cache cleaning for browser didn't solve my issue with modules versions 7.x.1 and modal window redirecting to homepage on submit.
Just for making sure, I'm setting new virtual host on my testing machine with fresh drupal install with minimal module install and settings. I'll report back here about both issues.
Vlajko
And to confirm (UPDATE):
After installing fresh installation of drupal (http://www.acquia.com/downloads Acquia Drupal 7.12.13) and only next couple of modules:
Chaos tools 7.x-1.0 ; File entity 7.x-2.0-unstable3+21-dev ; Media7.x-2.0-unstable3 ; Media Field7.x-2.0-unstable3 ; Media Internet Sources7.x-2.0-unstable3 ; Views7.x-3.3
Everything seems to be working as expected and selecting images from library view for content types in field file using media selector widget works as expected.
Comment #25
johan.gant CreditAttribution: johan.gant commentedHi,
I can currently repeat this issue in:
JS debug output is:
Uncaught TypeError: Cannot read property 'browser' of undefined
in media.popup.js, line 103Interestingly, Firefox seems to work, although I did have to purge the cache before it worked.
I'm using media 7.x-2.0-unstable3, ctools 7.x-1.0 and views 7.x-3.3.
Thanks,
Johan
Comment #26
dddave CreditAttribution: dddave commentedCan this be confirmed against the latest dev?
Comment #27
Dave ReidComment #28
jhedstromI'm seeing this issue on a site using Media 2.x, and this js error is appearing when this happens:
Uncaught ReferenceError: namespace is not defined
From media.library.js, line 3.
Comment #29
jhedstromLatest dev version got rid of the js error reported in #28.
Comment #30
j0rd CreditAttribution: j0rd commentedFor future discussion see this issue:
#1319528: Media browser view library exposed form submit problem
From what I can tell, that patch did not resolve the issue. I am running latest stable of CTools & Views. Recent -dev versions of file_entity & media
The problem with the patch from #1324238 is that, while it's discarding "enter" from "ajax submitting" the form, it's allowing it's default event to bubble up in the dom, and the default action for pressing enter in an input field on a form, is to submit the form.
Since this form's action is action="/", we end up with the homepage in the media browse popup dialog.
From debugging the CTools auto-submit.js, I don't see how it can solve this problem for anyone.
The CTools patch would need to check to see if e.keyCode === 13, then e.preventDefault(), or better yet, trigger the "AJAX submit". The problem is, while this makes sense for our needs with Media Browser Popup, I'm not sure if it makes sense for all other users of CTools.
So in our case, we might require preventingDefault() for all enters in our popup.
Does this problem still exist for other people?
Closing this issue as duplicate, as there's another one which is currently open and the maintainer can't duplicate this issue. So head over there and discuss.
#1319528: Media browser view library exposed form submit problem
Closing duplicate issue: