Edgewall Software
Modify

Opened 19 years ago

Closed 15 years ago

Last modified 10 years ago

#2839 closed enhancement (wontfix)

require username, comment when changing stuff

Reported by: joramagten@… Owned by: Christian Boos
Priority: low Milestone:
Component: wiki system Version: 0.9.3
Severity: minor Keywords: tracobject author comment
Cc: joramagten@…, leho@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

when editing a wiki page, roadmap, timeline, … require an author and comment

this to force users to add comments when committing I edited the function save in source:trunk/trac/wiki/model.py

    def save(self, author, comment, remote_addr, t=None, db=None):
        ...
        if t is None:
            t = time.time()

        if author == None or author == "" :
            raise TracError('Author field is empty')

        if comment == None or comment == "" :
            raise TracError('Comment field is empty')

        if self.text != self.old_text:
            cursor = db.cursor()
        ...

also in source:/trunk/templates/wiki.cs " (optional)" should be removed

248 	     <div class="field">
249 	      <label>Comment about this change (optional):<br />
250 	      <input id="comment" type="text" name="comment" size="60" value="<?cs
251 	        var:wiki.comment?>" /></label>
252 	     </div><br />
  • maybe this should better be done with an option in the config file
  • it might also be better to handle this in the POST processing of the form and color the field RED?

Attachments (1)

confirm-wiki.patch (1.4 KB ) - added by Emmanuel Blot 19 years ago.
Javascript to prompt the user about comment-less wiki page update

Download all attachments as: .zip

Change History (10)

comment:1 by Emmanuel Blot, 19 years ago

Priority: normallow
Severity: normalminor
Type: defectenhancement

At best, this could be defined as an option.

I personally use a Javacript to pop out a question to the user whether he's sure he wants to commit a new version of a wiki page without a comment.

(changing the ticket type: this is not a defect)

comment:2 by joramagten@…, 19 years ago

you're right, this is not a defect at all, sorry about that

that's also an interesting option, can you share the Javascript with us? thanks in advance

by Emmanuel Blot, 19 years ago

Attachment: confirm-wiki.patch added

Javascript to prompt the user about comment-less wiki page update

comment:3 by Emmanuel Blot, 19 years ago

Sample of a Javascript add-on that:

  • hides the wiki page Save button if the user has not previewed her changes
  • prompts the user if she attempts to save the changes without adding a comment

comment:4 by Christian Boos, 19 years ago

Keywords: tracobject added
Milestone: 1.0
Owner: changed from Jonas Borgström to Christian Boos

A IWikiManipulator anyone?

The work Alec did for tickets could be leveraged here for wiki pages.

comment:5 by xyanipheia, 16 years ago

We used this patch for a long time. Now, after switching to 0.11 we missed it. We usually use a minimum comment length of 5 chars to remind users not to forget the comment.

I'm working on a patch for 0.11.n.

  • variable name: [wiki] min_wiki_comment_size

The functionality should be implemented easily by a patch similar to #7065. Adding a new init variable in the [wiki] section and adding a few lines as in wiki/web_ui.py (see [7465]).

What I do not know is how to change the line depending on the init variable ("Comment about this change (optional)").

I would appreciate to have one of the following comments:

  • if min_wiki_comment_size == 0: "Comment about this change (optional)".
  • if min_wiki_comment_size > 0: "Comment about this change (mandatory, min. X characters)".

comment:6 by osimons, 16 years ago

This should be a plugin. The IWikiManipulator (and similar manipulators for other modules) is there just for that reason - so that plugins can implement logic to verifify and possibly veto any create/update event. The plugin can implement any rule for whatever purpose - as for instance used by SpamFilter.

I suggest we close this as wontfix.

in reply to:  6 comment:7 by Christian Boos, 15 years ago

Component: generalwiki system
Milestone: 1.0
Resolution: wontfix
Status: newclosed

Replying to osimons:

I suggest we close this as wontfix.

My personal take is that you have to educate the users anyway, otherwise even if you enforce comments, all you'll get will be some informative "did some changes" comments if the user is not convinced by the need to record the reasons for the change.

This "education" can be simply showing to the user the difference in page history, one with informative comments, the other without, and let him figure which one is the most useful.

Having the wiki blame feature would be yet another selling point (provided we would have that feature, of course ;-) ).

comment:8 by Ryan Ollos <ryano@…>, 15 years ago

I'll just post here what I posted in #8654 (somewhat of a duplicate) in case someone stumbles across here looking to implement this.

There is a ForceCommentPlugin on Trac-Hacks that forces a user to enter a comment. There is also a ForcePreviewPlugin that applies to both wiki pages and tickets.

comment:9 by lkraav <leho@…>, 10 years ago

Cc: leho@… added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.