Project:Comment CCK
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:tms8707056
Status:needs work
Issue tags:Module settings

Issue Summary

Is it possible to alter CCK fields using the controls around the comment box, but without having to actually enter a comment or subject?

Trying to mimic the behaviour of the project / project issue tracking module where you can just change fields then click submit without having an associated comment.

I'm not sure if this is a feature request or support request, so just picked one for the category.

Comments

#1

Title:Change fields via comment CCK, without entering a comment or comment subject» Option to override comment subject and body requirements

I like this idea.

#2

Assigned to:Anonymous» tms8707056
Status:active» needs review

I wanted this functionality too, so I created a patch to remove the comment requirement. I believe you can already disable the subject requirement in the comment settings for the content type so I didn't touch it.

The comment field is still displayed but it is no longer required. It would be nice to see a control panel where these options could be set by the user (required/not required, show/hide comment field, etc). I'm not touching that one though. Sorry.

Enjoy.

AttachmentSize
comment_not_required.patch 545 bytes

#3

Status:needs review» needs work

I still have a couple of questions before committing this feature. Why not direct this effort toward patching for the comment module?

And why, before I even apply this patch, can I submit a comment without a body? Oddly enough, I can already perform this needed functionality, but this makes it possible to leave blank comments. Perhaps comment_cck is already overriding some of the comment validation.

One problem with the patch though is that it still leaves the red asterisk signifying that it's required.

#4

The asterisk is not present on my site and should not be on yours because it is handled through FAPI. If the field is marked as not required then the asterik doesn't show up. The patch simply removes the requirement of this field through the hook_form_alter in the module.

The idea behind not patching the comment module is that disabling the comment field requirement for all site users would be ridiculous because of the very reason you mentioned - users can leave blank comments. However, what if I want to modify a CCK field for the node but not leave a comment? Patching the Comment CCK module will only disable the field requirement for users with the 'change cck fields through comments' permission. All other comment fields on the site would still require a comment to be entered.

I have attached a patch that adds another permission for the module. This permission will allow for the requirement to be removed for specific roles only. Users without this permission will still be able to change cck fields through comments (if they have that permission) but will be required to enter a comment.

The only other way that I can think of to remove the comment field requirement and prevent blank comments would be to check for changes to the cck fields. This could be accomplished in a validation function for the comment form. This shouldn't be difficult to implement if a custom validation hook is being used. Simply compare the values of the cck field being submitted against the original values in the node. If none of the fields are different then the form fails validation.

AttachmentSize
comment_not_required_v2.patch 907 bytes

#5

For this setting, I think it makes more sense as a configurable option. Perhaps it would fit well next to the option to enable it in CCK.

Also, a user might want to select which fields make can replace a body or just set it for any field.

#6

+1 when a change has been made via comment_cck the body of the comment might be left empty

nevertheless it should be a configurable option, since many sites might want to require a few words to explain the reason of the change

while some other cases don't make sense at all to "require" a comment body, like change to whom an issue is "assigned" or such

#7

Title:Option to override comment subject and body requirements» Allow empty comments

subscribe

#8

subscribe

nobody click here