Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Media Browser
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Mar 2014 at 16:36 UTC
Updated:
8 Feb 2017 at 17:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
amaisano commentedComment #2
amaisano commentedTurns out the View properly shows the results when accessing the overlay > Library through CKEditor's WYSIWYG plugin. It's just the field that finds no results...
Comment #3
nickbumgarner commentedI was having a similar issue earlier. Make sure you have those file types allowed in your Media Browser Settings.
Go to /admin/config/media/browser , and make sure your file types are checked off under "Allowed types in WYSIWYG".
Good luck!
Comment #4
devin carlson commentedAs @nickBumgarner mentioned, make sure that your field settings are permitting the appropriate files. You can also try updating to the latest -dev which includes fixes for a number of library restriction issues.
Feel free to reopen this issue if the suggestions don't fix the issue.
Comment #5
amaisano commented@nickBumgarner - The settings on the page you indicated have everything checked as recommended. The WYSIWYG editor "Library" and "My Files" browsers have always worked, it's the CCK field that uses "Media Browser" that isn't working - showing no results.
@Devin - I doublechecked the configuration for the field at /admin/structure/types/manage/resource/fields/field_upload_file and everything is enabled there as well - all plugins and all file types for Media Browser.
To clarify the problem again:
The Media Browser Views in the content type > field for "Library" and "My Files" are rendering, but are returning "No files available."
The Media Browser Views in the content type > body > WYSIWYG editor for "Library" and "My Files" properly return all the files I've uploaded using any upload button (both from the above content field and via the WYSIWYG editor plugin), as expected.
I will in the meantime try the most recent dev version, as you suggest.
Comment #6
amaisano commentedDevin, I confirm that the rev.73 of Media 2.x dev fixed this glitch. Thanks.
Comment #7
PI_Ron commentedI'm seeing this exact issue with latest media dev.
Comment #8
PI_Ron commentedThis workaround got things working for me again:
http://stackoverflow.com/questions/19311729/drupal-media-library-file-up...
Comment #9
zhuber commentedThe Query tags appear to be the culprit.
I've attached a patch that fixes this issue.
Here is my author info, for attribution:
--author="zhuber <zhuber@1437276.no-reply.drupal.org>"If my patch is committed, please attribute. Thanks
Comment #10
antonyanimator commenteddon't think the patch works on the current media dev
Comment #11
antonyanimator commentedComment #12
netbek commentedStill an issue for me too in most recent 7.x-2.x-dev. I've attached a patch because #2215619-9: Library and My Files in Overlay empty if there is more than one scheme did not apply cleanly.
Comment #13
jmuzz commentedIf you make this change you will see the files in your media library but they won't necessarally be filtered correctly anymore. For example if you have a separate image and video field then both images and videos will appear in the media browser for each of them.
Here are some details about what the line is doing. This is my view query and arguments when logged from hook_views_pre_execute()
I ran this query manually and it does return results. This is the query as output from hook_views_post_execute() (after the media_browser tag has somehow done its magic.)
This query has no results, even though some images have been uploaded. The query seems to be grouped incorrectly after the second OR, where it AND's all the remaining conditions, but a file can't be both public:// and private://, so no uploaded files will be found.
I removed the media_browser tag as recommended and now both videos and images appear in the library tab even though it is for an image field. This is not the correct result either, though they can be filtered to images by using the exposed filter.
The following issues may be related:
https://drupal.org/node/2089697
https://drupal.org/node/1331056
Comment #14
jmuzz commentedI think this should make the query work correctly with the media_browser tag.
Comment #15
socialnicheguru commentedthe last patch worked for me. thanks.
Comment #16
rbosscher commented#14 fixed for me too.
Comment #19
devin carlson commentedThanks for the patch!
Can someone post the steps to reproduce this using a fresh install of Media 7.x-2.x-dev? The current tests are pretty extensive but aren't catching this issue so it would be great if I could add additional test coverage along with the changes in #14.
Comment #20
aaron commentedComment #21
Yuri commented#14 fixed it for me too on a production site. I'm also using media youtube.
I think that if you install older versions and update it until the recent version the issue might to start appearing.
(apart from this issue the Media Browser overlay is a PITA..still tabs and exposed filters redirecting the wrong way etc..for years..)
Comment #22
ahillio commentedThe patch from #14 fixed the problem on a fresh Drupal 7.28 install with Media 7.x-2.x-dev.
These steps reproduce the problem (@Devin Carlson - is this what you were asking for?):
Not sure if this is sufficiently reviewed by community so I'll refrain from changing the status.
Comment #23
longlivelance commented@firestk Thanks for the detailed steps. Unfortunately, I cannot reproduce this error following them. I tried on a fresh install a few times to be certain, and still could not reproduce the issue. Once I get to step 6 in #22, my files are visible in the 'Library' and 'My files' tabs.
If you can think of any additional information to help us try and track this issue down, please let us know.
Comment #24
saltednutI tried to reproduce based on #22 but I am unable to also. In my tests, the images show up in the Media Browser without having to apply the patch. I tried this three times but still am not seeing this.
Comment #25
longlivelance commentedYesterday afternoon I believe we discovered one extra step required to reproduce this issue. In #22 step 4, rather then changing the existing images widget, create a new image field and give it the media browser widget, this then gives me a blank library even though files are present.
Comment #26
saltednutThe only time I see this is when I add a File field to my content type and set it to use the Media browser, but leave the default extension to txt. Then jpg do not show up or any other format but txt files. If I make the display png then I can only see png in the browser, etc.
Unable to reproduce based on #25.
Comment #27
longlivelance commentedAfter @brantwynn and I dug around a little more, we have discovered the exact issue. It only presents itself when you have multiple schemes setup, i.e., private and public.
The query logic before the patch was saying if the file is Public and the file is Private we want it, which is impossible. THe patch is basically, separating the schemes AND statements and appending them with an OR, which makes sense.
So you would get, files with Public OR private scheme instead of the impossible Public AND private scheme.
The patch in #14 correctly splits the conditions. Thanks @jmuzz for the fix, and actually calling out the issue when the patch was provided!
Comment #28
saltednutI have tested and can confirm this is a legitimate fix per #27 - this only applies when there is more than one file system scheme (ie: both public and private filesystem)
@jmuzz actually pointed this out quite a while ago in #13
Updated instructions:
Confirmed RTBC
Comment #29
devin carlson commentedAll of the work done to create the patch and test it is very much appreciated!
The attached patch adds a test to demonstrate the issue and prevent similar issues from occurring in the future.
Comment #31
devin carlson commentedCommitted #29 to Media 7.x-2.x.
Comment #36
dougn7 commentedHi guys, im having this same issue on 7.x-2.0-alpha4 and 7.x-2.0-alpha4+25-dev versions. I just did what @PI_Ron on comment #8 did and it worked.
Comment #37
runzipel commented@dougn7 thx, this worked for me too!
Comment #38
kevster commentedwow - #8 worked for me too, was banging my head against a wall for hours here... Im running media 7.2 rc5 and the problem is still there.. thx @PI_Ron !