Index: revision_moderation.module =================================================================== --- revision_moderation.module (revision 1914) +++ revision_moderation.module (working copy) @@ -84,6 +84,12 @@ '#default_value' => variable_get('revision_moderation_exempt', 1), '#description' => t('With this option enabled, users with the "administer nodes" privilege will bypass the moderation system, and their revisions will be published immediately.'), ); + $form['revision_moderation_edit_latest_revision'] = array( + '#type' => 'checkbox', + '#title' => t('Always edit latest pending revision'), + '#default_value' => variable_get('revision_moderation_edit_latest_revision', 0), + '#description' => t('With this option enabled, when choosing "edit revision" for a specific revision on the list of revisions page, if user has a pending revision for this node, the latest pending revision will be edited instead of the selected revision.'), + ); return system_settings_form($form); } @@ -168,7 +174,7 @@ // Get the revision author information for the message. $revision_uid = db_result(db_query('SELECT uid FROM {node_revisions} WHERE vid = %d', $node->vid)); $revision_author = user_load(array('uid' => $revision_uid)); - drupal_set_message(t('You are currently viewing a revision of this post created on @date by !author.', array('@date' => format_date($node->revision_timestamp, 'small'), '!author' => theme('username', $revision_author))) . theme('item_list', $links)); + drupal_set_message(t('You are currently viewing revision !revision_id of node !node_id created on @date by !author.', array('@date' => format_date($node->revision_timestamp, 'small'), '!author' => theme('username', $revision_author), '!revision_id' => $node->vid, '!node_id' => $node->nid)) . theme('item_list', $links)); } elseif ($node->revision_moderation == 1 && !$teaser) { // Notify admin if a node has pending revisions. @@ -186,15 +192,20 @@ case 'prepare': // If user has a pending revision for this node, load the latest version of // it instead. - if ($revisions = revision_moderation_get_node_pending_revisions($node->nid)) { - global $user; - foreach ($revisions as $revision) { - if ($revision->uid == $user->uid) { - drupal_set_message(t('Editing your latest revision, which is still pending moderation.')); - $node = node_load($node->nid, $revision->vid); - break; + $revision_moderation_edit_latest_revision = variable_get('revision_moderation_edit_latest_revision', 0); + if($revision_moderation_edit_latest_revision != 0){ + if ($revisions = revision_moderation_get_node_pending_revisions($node->nid)) { + global $user; + foreach ($revisions as $revision) { + if ($revision->uid == $user->uid) { + drupal_set_message(t('Editing your latest revision, which is still pending moderation.')); + $node = node_load($node->nid, $revision->vid); + break; + } } } + } else { + drupal_set_message(t('Revision !revision_id of node !node_id.', array('!revision_id' => $node->vid, '!node_id' => $node->nid))); } break; case 'submit':