The function media_browser_plus_form_file_entity_add_upload_alter() adds a hardcoded select element to the upload form.
A comment in this function already states @todo Check if we can replace this somehow by the real field widget.

The attached patch will solve this issue and show the widget from for example admin/structure/file-types/manage/image/fields/field_folder/widget-type.

Comments

matthiasm11 created an issue. See original summary.

matthiasm11’s picture

Status: Active » Needs review
StatusFileSize
new1.48 KB

I guess the same logic should be applied for the multiple upload form in media_browser_plus_form_file_entity_add_upload_multiple_alter.

The removed description should be added through for example admin/structure/file-types/manage/image/fields (and to the other file types)

matthiasm11’s picture

Title: Use field widget instead of hard coded » Use field widget instead of hard coded select
matthiasm11’s picture

StatusFileSize
new1.59 KB

Added support for other file types.

nixar’s picture

This is a real issue when the folder structure becomes important!

What other widget are you using this with?

FYI it doesn't seem to work here with Simple Hierarchical Select because even if the widget shows correctly on Step 1:

- Step 2 of multiple upload shows
Notice: Trying to get property of non-object in media_browser_plus_file_presave() (line 32 of D:\Inetpub\LocalUser\my_site\sites\all\modules\media_browser_plus\media_browser_plus.file.inc).

- Step 4 of a single upload is not able to retrieve the value set in step 1

It very well may be because of how SHS handles the data itself but if you have any thoughts on this, please let me know