The motivation here is to simplify the content editing UI.

1) This consists of backporting #788114: Unprivileged users should only get one text format by default (and the followup patch) to Drupal 7 and adding it to the Commons make file
2) Hide the filter tips (probably by setting #access to FALSE)
3) Any necessary config to support this (and of course, the upgrade path).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

japerry’s picture

FileSize
1.03 KB

Here is my first shot at it. Unfortunately, form_alter takes before the element information, so I can't get the '#filter' setting to stick if I put it in the element_info_alter hook.

This code doesn't require us to hack any of core -- and the patches talked about above are pretty involved.

Perhaps someone knows a better way to do it? If not, this code -does- work.. albeit for the body only. :-)

japerry’s picture

Status: Active » Needs review
Wim Leers’s picture

First: hook_module_implements_alter() allows you to reorder hook executions :)

Second: you're hardcoding the check for filtered_html. I doubt that is acceptable?

japerry’s picture

ahh right! all hooks, not just the series of which ones you're running. (aka the order of a particular hook, I didn't think it was a global alter)

We're currently using the filtered_html because thats what ships by default with commons, and more specifically the commons_wysiwyg feature. There is a default filter setting we could use, but I want to make sure this UI removal only is for basic users. A little out of scope for commons, but perhaps we need a configuration setting in the filter module to specify if the filter fieldset is shown or not.

ezra-g’s picture

Status: Needs review » Needs work

Marking as "needs work" per 3 & 4.

japerry’s picture

Status: Needs work » Needs review
FileSize
1008 bytes

This patch fixes the work in 3 and 4.

One decision that needs to be made is if you disallow users even access to filtered_html, they will see the help-text on plaintext fields. Personally I think thats acceptable, since just a plain box might be confusing and people might think they can put in html code.

Wim Leers’s picture

Indeed, any text format not using a WYSIWYG editor should still show filter tips.

I'm not sure which conventions you follow in Commons, but both docblocks violate coding standards. So, tentative NW.

japerry’s picture

Status: Needs review » Fixed

Fixed!

If you don't use filtered_html, you'll still get the filter tips, as designed.

http://drupalcode.org/project/commons_wysiwyg.git/commit/2fff50c

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