I have a content type with a file field for attachments like PDF files and used the media widget for selecting files.
When browsing the mediabrowser plus from the filefield PDF-files are not found. When using mediabrowserplus from wysiwyg the pdf files can be found.
I noticed that this is caused by a filter i didnt expect. When loading the contents of the folder there is a ajax call with a filter. See below:
admin/content/file/thumbnailsJSON?folder=folder_load_8530&page=0&filter=[{"property"%3A["type"%2C["image"]%2C"IN"]}]
I didn't expect all after '&filter='. Is this a bug or leftover? Or did i miss something?

To fix this i did a quick&dirty fix, with commenting lines 106 till 135 in media_browser_plus.module.
Line 106 reads the filter setting ('if (isset($_GET['filter'])) {').

Comments

DrDam’s picture

Hello, I work on this bug too.

Actualy, I find that the "filter image" are allready present on clic on "add media" 'Media file selector' button

/media/browser?render=media-popup&types%5Bimage%5D=image&enabledPlugins%5Bupload%5D=upload&enabledPlugins%5Bmedia_default--media_browser_1%5D=media_default--media_browser_1&enabledPlugins%5Bmedia_default--media_browser_my_files%5D=media_default--media_browser_my_files&enabledPlugins%5Blibrary_plus%5D=library_plus&schemes%5Bpublic%5D=public&file_directory=&file_extensions=jpg+jpeg+gif+png+txt+doc+docx+xls+xlsx+pdf+ppt+pptx+pps+ppsx+odt+ods+odp+mp3+mov+m4v+mp4+mpeg+avi+ogg+oga+ogv+wmv+ico&max_filesize=&uri_scheme=public&plugins=undefined

I search in media module where this type had been add

DrDam’s picture

I find a """clean""" solution

in one module déclare a méthod :

function my_module_field_widget_media_generic_form_alter(&$element, &$form_state, $context)
{
	if($element['#field_name'] == 'field_doc_file')
	{
		unset($element['#media_options']['global']['types']);
	}
}

In this case, the types aren't forced when cck field will be generated and I get my pdf in library

Enjoy !

salvis’s picture

Issue summary: View changes
Status: Active » Closed (outdated)