It makes sense that some fields may not way to use all available media browser plugins when using the media widget. We may want to restrict it to existing files, or when I can file the browser views patch, select specific file views to be used.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Needs review
FileSize
3.62 KB
Dave Reid’s picture

Forgot media_internet's plugin.

Dave Reid’s picture

Screenshots:

webflo’s picture

+1, i going to review this patch in a few days.

mstrelan’s picture

subscribe

Dave Reid’s picture

Wow, actually found a pretty big bug with this patch when using multiple media browser widgets on the same page. Now I finally understand some of the JS.

aaron’s picture

Status: Needs review » Needs work

Good start; the field settings page works as advertised. However, it breaks the library tab (at least if you have only that selected); no existing media will then display.

aaron’s picture

note the library tab still works in other places.

Dave Reid’s picture

Hrm, I'm inclined to say this is a bug in the library JS then - since only using the 'Upload' plugin on a field works just fine, so it's not necessarily related to only selecting one enabled plugin.

andypost’s picture

+1 Great!

I'm using hook_media_browser_plugins_alter() to unset plugins but making this as field settings makes a lot of sense

idflood’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work
FileSize
3.49 KB

great idea.The patch looks good and is working well. I have copied the patch line by line because it wouldn't apply. The library javascript is fixed by changing the listened event. It listens to "show" instead of "select" now, hope it doesn't break something (shouldn't).

idflood’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review
garbo’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review

Wow! that looks good indeed!

barraponto’s picture

It worked fine for me. I don't know whether it needs an update path, since I patched media before installing it. I recommend someone tries this out before RTBC.

Dave Reid’s picture

Issue tags: +Media Sprint 2011

.

robeano’s picture

Assigned: Unassigned » robeano

The latest patch does not apply cleanly to 7.x-2.x branch. I'll re-roll it and let's try testing it again. There is no need for an upgrade path for this particular change.

robeano’s picture

Please test this new patch which works with the latest 7.x-2.x

idflood’s picture

the patch looks, good. i will test it in 5 minutes.

edit: tested the patch, works as advised. (tested without restricting "module", then only library, then only upload. finally enabled media_youtube and internet source, also working)

Dave Reid’s picture

Status: Needs review » Reviewed & tested by the community

Let's DO IT!

andypost’s picture

Suppose a part of this patch "the listened event" should be backported to 7.x-1.x

robeano’s picture

Status: Reviewed & tested by the community » Fixed

Committed: d734cd2.

It is not clear to me that backporting part of this patch is necessary.

Dave Reid’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Fixed » Reviewed & tested by the community

I'd support backporting the one-line JS fix. Robin just go ahead and commit it without a patch. Then reset this issue back to 7.x-2.x.

robeano’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

Luckily @davereid knew better. I've committed the JS cleanup directly to the 7.x-1.x branch: ccecbd5.

Thanks @andypost and @davereid and #D7MediaSprint...it was easy to figure out with @davereid in the same room!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dealancer’s picture

Version: 7.x-2.x-dev » 7.x-1.0
Status: Closed (fixed) » Active

Was this patch commited to a 7.x-1.x? I could not find the way how to disable some upload methods. Please advice.

Dave Reid’s picture

Version: 7.x-1.0 » 7.x-2.x-dev
Status: Active » Closed (fixed)

No. 7.x-1.x is not getting any new features backported, only bug fixes.