Closed (fixed)
Project:
Util
Version:
6.x-2.3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2010 at 20:02 UTC
Updated:
30 Jun 2010 at 17:00 UTC
There is no functionality in Drupal 6 to force users to enter a Revision Log. The following page explains how to make your own module to do this.
<?php
function enforce_revlog_nodeapi(&$node, $op, $arg = 0){
switch($op)
{
case 'validate':
// if revision is checked and log message is empty, complain.
// add "&& $node->nid" below to ignore empty log for new content.
if ( $node->revision && empty($node->log) ) {
if ( user_access('administer nodes'))
form_set_error('log', t('Please enter a revision log message or uncheck the revision checkbox.'));
else
form_set_error('log', t('Please enter a revision log message.'));
}
}
}
?>
It would be nice to have this code in a module that I can simply download from the drupal site instead of maintaining my own modules. If you don't implement this that's fine, just thought it would be handy for this to be part of the util module which I install on all my sites already.
Comments
Comment #1
nancydruI think this is a good idea. Would it be better to just change the field to "required" in a hook_form_alter?
Comment #2
nancydrucommitted to 6.x-3.x-dev