--- revision_moderation.module	2007-02-20 07:55:17.000000000 -0800
+++ revision_moderation.module	2007-05-12 22:27:52.000000000 -0700
@@ -166,22 +166,22 @@ function revision_moderation_nodeapi(&$n
 
   // Only do this logic for non-admin users on nodes with revision moderation
   // turned on.
-  if ($node->nid && $node->revision_moderation == 1 && (!user_access('administer nodes') || !variable_get('revision_moderation_exempt', 1))) {
+	if ($node->nid && $node->revision_moderation == 1 && (!user_access('administer nodes') || !variable_get('revision_moderation_exempt', 1))) {
     switch ($op) {
-      case 'prepare':
+//      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;
-            }
-          }
-        }
-        break;
+//        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;
+//            }
+//          }
+//        }
+//        break;
       case 'submit':
         $current_vid = db_result(db_query('SELECT vid FROM {node} WHERE nid = %d', $node->nid));
         $node->original_node = node_load($node->nid, $current_vid);
@@ -269,7 +269,7 @@ function revision_moderation_pending_rev
  */
 function revision_moderation_get_all_pending_revisions($limit) {
   // Obtain a list of nodes with revisions higher than current published revision.
-  $sql = "SELECT n.nid, r.vid, n.type, r.title, r.body, r.uid, r.timestamp FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid WHERE r.vid > n.vid ORDER BY r.vid DESC LIMIT %d";
+  $sql = "SELECT n.nid, r.vid, n.type, r.title, r.body, r.uid, r.timestamp FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid WHERE r.vid > n.vid ORDER BY r.vid ASC LIMIT %d";
   $result = db_query($sql, $limit);
   $revisions = array();
   while ($revision = db_fetch_object($result)) {
