Hi,

Great module, but i really miss one important feature:

To disallow input format of comments independent to its node.

ATM, if you enable for a node a input type its always enable/disabled for comments too.
You only can set a different default type.

Thats bad in this szenario:

You allow normal auth. users to write blogs and comments.
Blogs are using restricted HTML and put in a moderate queue to block spam bots.
For comments, you use a spam blocker like akismet/mollon and allow direct posting.
BUT you don't want allow html - pure text only.

ATM that can't be done because the HTML setting of the node will be valid for the
comments too.

I think a node type setting like for disallow input formats for content types is not needed,
a global comment input format would solve this issue.

Anyway, if that it not make into the module - how can it be done?
Will a template.php override help?

CommentFileSizeAuthor
#4 better_formats_enforce_default.zip3.59 KBmtsanford

Comments

dragonwize’s picture

Status: Active » Postponed

I agree that would be a nice feature to have. Marking this as postponed until I get a chance to find out where I want to place it in the roadmap.

For now, a possible solution for you and how I normally handle this situation, is to disable format selection for untrusted users. That will force them to use the default format and essentially limit both the node type and comment to their default format only.

td540’s picture

So what's the latest on this?

I've been looking for a way to disable "input formats" for comments, for ALL types of users.

mtsanford’s picture

Yes, I was just trying to figure out how to do this....

I don't want my users to be able to do all the crazy stuff I let them do when posting specialized nodes types, when they are just posting a comment to a node of that type.

In most cases, the comment format for all users should be the same for all roles, regardless of what formats are available when creating nodes of the type being commented on. It's just a comment after all.

This would be a mighty sweet improvement. :)

mtsanford’s picture

StatusFileSize
new3.59 KB

I spent today banging together a module to make this go.

dragonwize, could you take a peek at this and see what you think? I'd like to make this a contributed module, but have never done so before so it might take a while before I get to it.

In the mean time I attached a zip.

Not only does it (optionally) restrict input formats for comments, it also (optionally) restricts input formats for node body_field. This is useful for when you want to have one format for comments, and one for the node body, but don't want to confuse node creators with options.

It does so by using hook_form_alter *after* better formats does it's hook_form_alter. Not ideal, but it works and it's a good temporary solution for those of us that *need* this feature.

dragonwize’s picture

Hi mtsanford. Thanks for contributing.

However, unless I am missing the point of this issue entirely, I think you have way over-worked a simple issue.

  1. By un-checking the "Show format selection" permission (admin/user/permissions), the same result is already achieved as checking both boxes your module provides. The only difference is that yours doesn't work on CCK and BF does.
  2. As for removing selection from only each node type seperately, BF already handles this through "Allowed formats per node type". Simple disallow all but 1 format for the node type(s) you wish and the user will be forced to use that format, including existing content when it is edited which is great for all your existing content users may have set formats on.
  3. As for removing the option to show format selection different from nodes (which is what I am under the impression this issues is about to begin with), all that needs done is to seperate out the current "Show format selection" permission into 2 permissions, 1 for nodes and 1 for comments. I have been planning the next point release and will be adding this feature to BF for the next release. It is a fairly simple task except for ensuring a clean upgrade path which will take a few lines of code.

If there is a use case not covered by those 3, I would like to hear it so that I can make the module better.

If you want to try a stab at a patch for BF to handle the above use case #3, I would love that and will help out however I can as well.

mtsanford’s picture

LOL. Seems I totally misunderstood this issue. On giving it more thought and playing around some more...you are right. What I've done is overkill.

Ah, well, not a total loss as I learned some neat things about Drupal core :)

I think it does however provide a workaround for this issue that some might find useful. By checking "Only allow initial format for comments", even users with "Show format selection" permission will not see the format selection in the comments form. Cutting out a few lines of code would make it do only that specific purpose.

Much better though to have different "show format selection for nodes" and "show format selection for nodes" permissions, as you mentioned in #3.

dragonwize’s picture

Status: Postponed » Active

Added to the roadmap for 1.1. Will be working on this for that release.

dragonwize’s picture

Version: 6.x-1.0-beta6 » 6.x-1.0
Status: Active » Fixed

Committed to the 6--1 branch.

Status: Fixed » Closed (fixed)

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

not_Dries_Buytaert’s picture

Title: Allow setting different (default) input formats for nodes and comments » Allow setting different default (!) input formats for nodes and comments
Status: Needs work » Active

Typically, authors of nodes may have less strict formatting options for nodes then for the comments they may submit to nodes (i.e. also of OTHER authors).
This means that different (wysiwyg) editors may be needed too for submitting nodes and comments.
So and as was pointed out earlier in this topic, the input formats for nodes and comments may be different and thus the defaults for both nodes AND comments should be configurable. I suggest to (in '{domain}/admin/settings/filters'):
1) rename the label of the current "Default" column to "Default for nodes" and
2) next to that column add a column labeled "Default for comments"

not_Dries_Buytaert’s picture

Title: Disallow input formats for comments » Allow setting different (default) input formats for nodes and comments
Version: 6.x-1.0 » 6.x-1.2
Status: Closed (fixed) » Needs work

So, also a distinction is needed for these privileges of the 'better_formats module' in '{domain}/admin/user/permissions': "show format tips" and "show more format tips link"

dragonwize’s picture

Title: Allow setting different default (!) input formats for nodes and comments » Allow setting different (default) input formats for nodes and comments
Status: Active » Closed (fixed)

@not_Dries_Buytaert
Your issue is completely different than this one so please do not change it, you should probably create a new issue.

But the answer to your question is that that is already possible. Go to admin/settings/filters/defaults for global defaults and edit your node type ex:admin/content/node-type/page.

dragonwize’s picture

Title: Allow setting different (default) input formats for nodes and comments » Disallow input formats for comments
Version: 6.x-1.2 » 6.x-1.0
not_Dries_Buytaert’s picture

Sorry, I didn't mean to hijack this request. I just felt that the missing option to configure the default value was still part of the function/ solution the startposter was requesting for.
Anyhow, as you suggested, I just submitted a new request: http://drupal.org/node/910550

bobby endarr ramdin’s picture

Not sure if this is the "right way" but you can remove the formatting option by setting the form to display:none in the css, so:

#comment-form .collapsible{display:none;}