Index: favorite_nodes.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/favorite_nodes/favorite_nodes.module,v
retrieving revision 1.5.2.19
diff -b -u -p -r1.5.2.19 favorite_nodes.module
--- favorite_nodes.module	23 Sep 2008 17:38:00 -0000	1.5.2.19
+++ favorite_nodes.module	29 Sep 2008 15:36:06 -0000
@@ -208,7 +208,7 @@ function favorite_nodes_block($op = 'lis
               }
               $block['content'] .= theme('item_list', $items, variable_get(FAVORITE_NODES_BLOCK . $type->type, $type->name));
             }
-            $sql = "SELECT COUNT(*) FROM {node} n INNER JOIN {favorite_nodes} f USING(nid) WHERE n.type = '%s' AND f.uid = %d ORDER by f.last DESC";
+            $sql = "SELECT COUNT(*) FROM {node} n INNER JOIN {favorite_nodes} f USING(nid) WHERE n.type = '%s' AND f.uid = %d";
             $count = db_result(db_query($sql, $type->type, $user->uid));
             if ($count > variable_get(FAVORITE_NODES_BLOCK_LIMIT, 5)) {
               $block['content'] .= "<div class=\"more\">\n";
@@ -431,8 +431,9 @@ function favorite_nodes_get($uid, $type 
   $row = array();
   if ($type && variable_get(FAVORITE_NODES_NODE_TYPE . $type, 0)) {
     $sql = "SELECT n.nid, n.title, f.uid, f.last FROM {node} n INNER JOIN {favorite_nodes} f ON n.nid = f.nid WHERE n.type = '%s' AND f.uid = %d ORDER by f.last DESC";
+    $count_sql = "SELECT COUNT(*) FROM {node} n INNER JOIN {favorite_nodes} f ON n.nid = f.nid WHERE n.type = '%s' AND f.uid = %d";
 
-    $result = pager_query($sql, $limit, 0, null, $type, $uid);
+    $result = pager_query($sql, $limit, 0, $count_sql, $type, $uid);
     if ($result && db_num_rows($result) > 0) {
       while ($data = db_fetch_object($result)) {
         $row[$data->nid] = $data;
