Edgewall Software

Ticket #2839 (new enhancement)

Opened 2 years ago

Last modified 2 years ago

require username, comment when changing stuff

Reported by: joramagten@… Owned by: cboos
Priority: low Milestone: 1.0
Component: general Version: 0.9.3
Severity: minor Keywords: tracobject author comment
Cc: joramagten@…

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

confirm-wiki.patch (1.4 kB) - added by eblot 2 years ago.
Javascript to prompt the user about comment-less wiki page update

Change History

Changed 2 years ago by eblot

  • priority changed from normal to low
  • type changed from defect to enhancement
  • severity changed from normal to minor

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)

Changed 2 years ago by joramagten@…

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

Changed 2 years ago by eblot

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

Changed 2 years ago by eblot

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

Changed 2 years ago by cboos

  • keywords tracobject added
  • owner changed from jonas to cboos
  • milestone set to 1.0

A IWikiManipulator anyone?

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

Add/Change #2839 (require username, comment when changing stuff)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.