Hi, I recently upgraded my Commons site from a pretty old 7.x-3.x version (from about a year ago) to the latest and greatest version (7.x-3.26). When staff users (who are non-admins) go to make a Post, they used to have an option of changing the text format from the default (Plain Text) to one of the other options, such as Filtered HTML or Full HTML. Now, the format tips and drop-down are hidden. I've checked the settings and permissions for everything and I cannot figure out what's wrong. Everything works fine for admins.

I noticed this issue: #1949552: Hide filter tips, Restrict non-admins to a single text format

So it might be working this way by design?

Comments

leonis_csem’s picture

I also experience this behaviour after a recent upgrade. Yet when editing posts or groups, which have been created with the Filtered HTML text format, the WYSIWYG editor shows up.

jlea9378’s picture

Title: Non-admins unable to change text format » All admin to choose which roles can change text format
Version: 7.x-3.26 » 7.x-3.x-dev
Category: Support request » Feature request

So apparently this was done intentionally (only allowing admins to change the text format). However, unless I'm missing something, this means that we have to give the permission "Administer Filters" to any role we want to be able to change the text format on a node. This doesn't work for our site, because I do not want non-admins to be able to mess around with the filters and formats. However, I do want them to be able to choose which format to use when posting content.

I think a better solution would be an option in the configuration area that allows the admin to set which roles he does (or does not) want the format drop-down and tips hidden from.

Since we needed this fixed ASAP, I accomplished this in code by changing line 39 of commons_wysiwyg.module to show this for any role that has the permission "Use text format Full HTML":

From:

  // Privileged users should be able to view and modify filter formats.
  if (user_access('administer filters', $account)) {
    return $element;
  }

To:

  // Privileged users should be able to view and modify filter formats.
  if (user_access('use text format full_html', $account)) {
    return $element;
  }

Hopefully this helps somebody, and hopefully someone will implement a feature for this in the UI so we don't have to keep hacking the module (unless there is another way to solve this problem?). ;)

jlea9378’s picture

Title: All admin to choose which roles can change text format » Allow admin to choose which roles can change text format
voughndutch’s picture

So is this confirmation that hide formats module doesn't work with commons, and you have to go in to code to override?