Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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).
Comment | File | Size | Author |
---|---|---|---|
#6 | 1949552-nofiltertext-2.patch | 1008 bytes | japerry |
#1 | 1949552-nofiltertext.patch | 1.03 KB | japerry |
Comments
Comment #1
japerryHere 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. :-)
Comment #2
japerryComment #3
Wim LeersFirst:
hook_module_implements_alter()
allows you to reorder hook executions :)Second: you're hardcoding the check for
filtered_html
. I doubt that is acceptable?Comment #4
japerryahh 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.
Comment #5
ezra-g CreditAttribution: ezra-g commentedMarking as "needs work" per 3 & 4.
Comment #6
japerryThis 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.
Comment #7
Wim LeersIndeed, 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.
Comment #8
japerryFixed!
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