I think a common stumbling step for enabling Media support with WYSIWYG is people enable the media button in the WYSIWYG config but do not realize or read that you have to enable the filter for the text format. So let's disable the media button until the text format has the media filter enabled - and also link to the text format page if it is not.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 1238772-11-media-disable_wysiwyg_button.patch | 2.85 KB | becw |
| #8 | media-disable-wysiwyg-button-1238772-8.patch | 1.96 KB | aaron |
| #6 | 1238772-media-disable-wysiwyg-button-6.patch | 1.91 KB | amateescu |
| #2 | 1238772-media-disable-wysiwyg-button.patch | 1.92 KB | dave reid |
| #1 | 1238772-media-disable-wysiwyg-button.patch | 1.84 KB | dave reid |
Comments
Comment #1
dave reidScreenshot:
Without the 'media filter' enabled for the wysiwyg's text format.

Comment #2
dave reidAdded a comment to media_form_wysiwyg_profile_form_alter()
Comment #3
dave reidSummary of the patch:
- Does not actually disable the checkbox but rather uses the fun technique I learned in Pathauto to show a validation warning both when a form is submitted and when a form is first displayed.
- Displays a error "The media filter must be enabled for the [format name] format in order to use the Media browser WYSIWYG button." - the format name is linked to its config page to enable the media filter (e.g. admin/config/content/formats/filtered_html).
Comment #4
aaron commentednice one! i'll look tomorrow.
Comment #6
amateescu commentedRe-rolled and tested #2. Looks great to me.
Comment #7
aaron commentedends up linking to admin/config/content/wysiwyg/profile/filtered_html/%40filter-link
Comment #8
aaron commentedthis fixes that, and also redirects back to the wysiwyg page after fixing the filter.
Comment #9
idflood commentedThe patch looks good and it's working as advised in #8. I've been redirected to the right url after enabling the media filter.
Comment #10
amateescu commentedLinking related issue (with a broader scope though): #1070974: Additional help to indicate that the Media Filter must be enabled.
Comment #11
becw commentedI was initially confused by this because the error text doesn't use same text as the media filter checkbox label. It makes the error more verbose, but I would consider using that. Here's a re-roll with that change, and also two small changes to the filter label and description to match core filters.
Comment #12
dave reidFinally committed this to both 7.x-2.x and 7.x-1.x.
http://drupalcode.org/project/media.git/commit/651e091
http://drupalcode.org/project/media.git/commit/e78bbae