? revision_moderation-4.7.x-duplicate_messages_0.patch
Index: revision_moderation.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/revision_moderation/revision_moderation.module,v
retrieving revision 1.26.2.10
diff -u -p -r1.26.2.10 revision_moderation.module
--- revision_moderation.module	20 Feb 2007 15:55:17 -0000	1.26.2.10
+++ revision_moderation.module	9 Oct 2007 11:10:28 -0000
@@ -135,30 +135,32 @@ function revision_moderation_nodeapi(&$n
       $node->revision_moderation = db_result(db_query('SELECT revision_moderation FROM {revision_moderation} WHERE nid = %d', $node->nid));
       break;
     case 'view':
-      // Display more descriptive message at the top of node revision views, including operations
-      // that the current user has available to them.
-      $current_vid = db_result(db_query('SELECT vid FROM {node} WHERE nid = %d', $node->nid));
-      if ($node->vid != $current_vid) {
-        drupal_set_message(t('You are currently viewing a revision of this post created on @date by @author.', array('@date' => format_date($node->changed, 'small'), '@author' => $node->name)));
-        if (node_access('update', $node)) {
-          drupal_set_message(l(t('Edit revision'), "node/$node->nid/revisions/$node->vid/edit"));
-        }
-        if (user_access('revert revisions')) {
-          // If this revision is old, show an option to revert to it.
-          // Otherwise, show an option to publish it.
-          if ($node->vid < $current_vid) {
-            drupal_set_message(l(t('Revert to revision'), "node/$node->nid/revisions/$node->vid/revert"));
+      if (!$teaser) {
+        // Display more descriptive message at the top of node revision views, including operations
+        // that the current user has available to them.
+        $current_vid = db_result(db_query('SELECT vid FROM {node} WHERE nid = %d', $node->nid));
+        if ($node->vid != $current_vid) {
+          drupal_set_message(t('You are currently viewing a revision of this post created on @date by @author.', array('@date' => format_date($node->changed, 'small'), '@author' => $node->name)));
+          if (node_access('update', $node)) {
+            drupal_set_message(l(t('Edit revision'), "node/$node->nid/revisions/$node->vid/edit"));
           }
-          else {
-            drupal_set_message(l(t('Publish revision'), "node/$node->nid/revisions/$node->vid/publish"));
+          if (user_access('revert revisions')) {
+            // If this revision is old, show an option to revert to it.
+            // Otherwise, show an option to publish it.
+            if ($node->vid < $current_vid) {
+              drupal_set_message(l(t('Revert to revision'), "node/$node->nid/revisions/$node->vid/revert"));
+            }
+            else {
+              drupal_set_message(l(t('Publish revision'), "node/$node->nid/revisions/$node->vid/publish"));
+            }
+            drupal_set_message(l(t('Delete revision'), "node/$node->nid/revisions/$node->vid/delete"));
           }
-          drupal_set_message(l(t('Delete revision'), "node/$node->nid/revisions/$node->vid/delete"));
         }
-      }
-      elseif ($node->revision_moderation == 1) {
-        // Notify admin if a node has pending revisions.
-        if (user_access('view revisions') && arg(2) != 'revisions' && revision_moderation_get_node_pending_revisions($node->nid)) {
-          drupal_set_message(t('This post has one or more pending revisions: <a href="@list">view list of revisions</a>.', array('@list' => url("node/$node->nid/revisions"))));
+        elseif ($node->revision_moderation == 1) {
+          // Notify admin if a node has pending revisions.
+          if (user_access('view revisions') && arg(2) != 'revisions' && revision_moderation_get_node_pending_revisions($node->nid)) {
+            drupal_set_message(t('This post has one or more pending revisions: <a href="@list">view list of revisions</a>.', array('@list' => url("node/$node->nid/revisions"))));
+          }
         }
       }
       break;
