Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

When a node is edited I want to always create a new revision. I do not want people to be able to turn this off. How can I do this?

share|improve this question
admin/content/node-type/[node-type] look at 'Process' fieldset – dobeerman Apr 13 '11 at 2:22

2 Answers

up vote 11 down vote accepted

To enabled automatic revision creation go to the content type page (admin/content/node-type) and select edit for whatever content type you wish to have revision created automatically.

Under the workflow fieldset there's going to be an option "Create new revision" make sure you check that box and save your content type settings.

Now under your permissions (admin/user/permissions) be sure to not to give your users the "administer nodes" permission. This will prevent them from overwriting that option.

share|improve this answer
Is this for drupal 6 only? – Sam152 Jun 28 '11 at 3:59
This works for D7 as well. Check also Revisioning module, which allows the control over the workflow. – Ivanhoe123 Sep 4 '12 at 11:39

There's a few different ways to do this, but assuming you want to do it without disabling the administer nodes permissions for users, probably the easiest way is to just turn off access to the Create new revision checkbox by creating a custom module that implements hook_form_alter():

function sandbox_form_alter(&$form, &$form_state, $form_id) {
  // Node forms have an ID of the form CONTENTTYPE_node_form: only modify those
  if (strstr($form_id, '_node_form') === FALSE) {
    return;
  }

  if (isset($form['revision_information'])) {
    $form['revision_information']['revision']['#access'] = FALSE;
  }
}

This way, users don't have the ability to change the default value of the checkbox, which is set on the settings page for each content type.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.