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.

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new1.84 KB

Screenshot:

Without the 'media filter' enabled for the wysiwyg's text format.
Only local images are allowed.

dave reid’s picture

StatusFileSize
new1.92 KB

Added a comment to media_form_wysiwyg_profile_form_alter()

dave reid’s picture

Summary 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).

aaron’s picture

nice one! i'll look tomorrow.

Status: Needs review » Needs work

The last submitted patch, 1238772-media-disable-wysiwyg-button.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB

Re-rolled and tested #2. Looks great to me.

aaron’s picture

Status: Needs review » Needs work

ends up linking to admin/config/content/wysiwyg/profile/filtered_html/%40filter-link

aaron’s picture

Status: Needs work » Needs review
StatusFileSize
new1.96 KB

this fixes that, and also redirects back to the wysiwyg page after fixing the filter.

idflood’s picture

The patch looks good and it's working as advised in #8. I've been redirected to the right url after enabling the media filter.

amateescu’s picture

Issue tags: +Media Sprint 2011

Linking related issue (with a broader scope though): #1070974: Additional help to indicate that the Media Filter must be enabled.

becw’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.85 KB

I 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.

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

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