Hi,

I have a content type, where I have added a media field for youtube videos (and nothing else, thanks to the 2.0 way of selecting which tabs to show in the media browser) but I'd like to be able to disable Youtube/web linking in the Media Browser found in WYSIWYG/TinyMCE - much like the one for content types. Is this at all possible?

I'll even be happy for a quick hack.

Files: 
CommentFileSizeAuthor
#28 media-ckeditor-browser-configs-1434118.28.patch556 bytesdafeder
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-ckeditor-browser-configs-1434118.28.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#17 media-wysiwyg-browser-configs-1434118.17.patch3.05 KBmrfelton
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#9 media-wysiwyg-browser-configs-1434118-4.patch3.09 KBvalor
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#4 media-wysiwyg-browser-configs-1434118-4.patch5.54 KBvalor
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Comments

dddave’s picture

Version:7.x-2.0-unstable3» 7.x-2.x-dev
Category:feature» support

This might enhance your chances of a response. ;) Do you still need one btw?

trillex’s picture

Oh, my bad. :)

Yeah, project is on a stand still but it would be neat to have, thank you. :)

Equ’s picture

Subscribing. I also need a separate config for WYSIWYG. Right now in WYSIWYG's media browser there are at least 3 tabs: Upload, Library, View Library + any other custom views. I'd like to be able to chose which view (i.e. "Enabled browser plugins") to display in WYSIWYG's media browser.

Thanks!

valor’s picture

StatusFileSize
new5.54 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

The following patch patches Media's wysiwyg to add a separate configuration settings in admin/config/media/browser that enables turning on/off browsers plugins in wysiwyg media plugin.

valor’s picture

Status:Active» Needs review
mrfelton’s picture

Status:Needs review» Needs work

Patch results in the following error when trying to visit admin/config/content/wysiwyg/profile/wysiwyg_filter/edit

PHP Fatal error: Call to undefined function media_wysiwyg_button_element_validate() in /Users/tom/workspace/ks/includes/form.inc on line 1834

Did you mean to remove that function? I get this even after clearing the cache, and the registry.

mrfelton’s picture

Also, I get nothing showing up under Enabled browser plugins in WYSIWYG at /admin/config/media/browser

valor’s picture

The patch was applied to an older dev version of Media, I will attach a new patch in a while that targets the latest dev version of Media 2

valor’s picture

Status:Needs work» Needs review
StatusFileSize
new3.09 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Reproduced against latest dev version (7.x-2.0-unstable3+46-dev)

Equ’s picture

The provided patch works for me (applied against 7.x-2.0-unstable3+47-dev).

Dave Reid’s picture

Issue tags:+sprint, +Media Initiative
Equ’s picture

The last message seems to be empty...

RobW’s picture

Testing this and works great so far. Thanks Valor.

+1 RTBC.

aaron’s picture

Status:Needs review» Needs work

Considering the "If no plugins are selected, they will all be available" message, I believe that it would be better to default to an empty array. Otherwise, if you have any other tabs available to your system (such as the YouTube tab or the new My Files tab), they will not appear by default.

aaron’s picture

Additionally, if you do not select any checkboxes, you get an error message: Error message
Enabled browser plugins in WYSIWYG field is required.

RobW’s picture

Probably out of scope of this particular issue/patch, but some other config that would be nice to set in this UI:

  • Enable/disable available view modes for WYSIWYG insert
  • Default view mode for WYSIWYG insert
  • Autosubmit per file type
mrfelton’s picture

Status:Needs work» Needs review
StatusFileSize
new3.05 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Here is an updated patch that fixes the issues described in #14 and #15.

tsvenson’s picture

How did I manage to miss this patch? Just saw it in action in @aaron's Media YouTube demo video.

While being able to configure this global for the whole site is a great improvement, it will be needed to configure this per individual text area as well.

Would it be possible to have a global setting, but then be able to override when a tailored configuration is needed?

John Pitcairn’s picture

Patch at #17 works for me, thanks. I needed to prevent users uploading in the wysiwyg browser to ensure image file paths are honored, and giving users multiple browser view libraries just confuses them...

mrfelton’s picture

I'm not convinced about a per text area configuration, but per wysiwyg profile might be nice.

tsvenson’s picture

@mrfelton: Wysiwyg profiles added ontop of the text filters and are designed to be reusable in many different places. Thus, the same profile can be used on for example a content type, a taxonomy term page or even a user profile page.

Thus if it was only possible to define for example the storage path for the profile, that would only result in a lot of wysiwyg profiles that has only the media settings differencing.

Then add do that users also have the ability to change what profile they will use on a text area. Thus media for the same content type can then end up in many different storage locations simply due to that it will be very hard to get control over this.

No, this has to be optional for each text area. Otherwise it will be unusable and only create confusion.

yashadev’s picture

Status:Needs review» Reviewed & tested by the community

Applied, and works as it should. Thanks

mpgeek’s picture

A friendly confirmation that the patch in #17 applies cleanly and works as designed.

dafeder’s picture

Has anyone had any luck getting this same behavior in the ckeditor module (as opposed to wysiwg)?

mpgeek’s picture

@dafeder, it should work if you use WYSIWYG with the CKEditor (or any other) library.

xcafebabe’s picture

Thanks @mrfelton!!! #17 It works as expected . The community rocks!!!

dafeder’s picture

@mpgeek - understood, but I was asking about the ckeditor module specifically. It seems like if the media button also works with ckeditor module (which it does), then this should too.

dafeder’s picture

StatusFileSize
new556 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-ckeditor-browser-configs-1434118.28.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

I believe that if this extra condition was implemented in addition to #17, we could handle everything else on the ckeditor side, pulling in the wysiwyg vars.

Status:Reviewed & tested by the community» Needs work

The last submitted patch, media-ckeditor-browser-configs-1434118.28.patch, failed testing.

dafeder’s picture

Holding off on ckeditor integration until that module's maintainers look into it: #1649464: Allow media-7.x-2.x to configure browser plugins for CKeditor plugin

mpgeek’s picture

Status:Needs work» Needs review

Patch at #17 needs review. Patch at #28 is a separate issue.

Devin Carlson’s picture

Category:support» feature
Status:Needs review» Reviewed & tested by the community

The patch in #17 applied cleanly and allowed me to select which tabs were shown in the media browser.

mrfelton’s picture

Ok, thats 6 positive reviews, and tests passing. I reckon commit this so that people can at least configure the browser for WYSIWYG in general, and consider creating a follow up issue to enhance it to a per field configuration option, which would give a lot more flexibility and would be a better long term solution.

aaron’s picture

Status:Reviewed & tested by the community» Fixed

I have just committed this: http://drupalcode.org/project/media.git/commit/cd40b7b. Things for all the great work everyone!

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

Anonymous’s picture

Issue summary:View changes

Added about quick hack