diff --git a/workbench_moderation.module b/workbench_moderation.module index c28261b..ec304c3 100644 --- a/workbench_moderation.module +++ b/workbench_moderation.module @@ -903,6 +903,15 @@ function workbench_moderation_form_node_type_form_alter(&$form, $form_state) { 'visible' => array(':input[name="node_options[moderation]"]' => array('checked' => TRUE)), ), ); + $form['workflow']['workbench_moderation_revert_from_published'] = array( + '#title' => t('Revert when published'), + '#type' => 'checkbox', + '#default_value' => variable_get('workbench_moderation_revert_from_published_' . $form['#node_type']->type, TRUE), + '#description' => t('If this box is checked, then when a published node is edited, its moderation state will be set back to the default state.'), + '#states' => array( + 'visible' => array(':input[name="node_options[moderation]"]' => array('checked' => TRUE)), + ), + ); $form['#validate'][] = 'workbench_moderation_node_type_form_validate'; } @@ -945,9 +954,9 @@ function workbench_moderation_form_node_form_alter(&$form, $form_state) { '#value' => $moderation_state ); - // We have a use case where a published node is being edited. This will always - // revert back to the original node status. - if ($moderation_state == workbench_moderation_state_published()) { + // We have a use case where a live node is being edited. This will + // revert back to the original node status if set for the node type. + if (variable_get('workbench_moderation_revert_from_published_' . $form['type']['#value'], TRUE) && ($moderation_state == workbench_moderation_state_published())) { $moderation_state = workbench_moderation_state_none(); }