--- relatedlinks.module.20121025	2012-10-25 10:18:30.000000000 +0200
+++ relatedlinks.module	2012-10-25 10:25:12.000000000 +0200
@@ -772,15 +772,19 @@
 
     $order[] = 'count DESC';
     $order[] = 'sticky DESC';
+    $orderAttributes[] = 'sticky';
+
     if ($date) {
       $order[] = 'created DESC';
+      $orderAttributes[] = 'created';
     }
     if ($comments) {
       $order[] = 'ncs.comment_count DESC';
     }
     $order[] = 'promote DESC';
+    $orderAttributes[] = 'promote';
 
-    $sql = 'SELECT n.nid, n.title, n.type, n.uid, COUNT(tn.tid) as count, ncs.comment_count FROM {node} n INNER JOIN {term_node} tn USING (nid) LEFT JOIN {node_comment_statistics} ncs USING (nid) WHERE '. implode(' AND ', $where) .' GROUP BY n.nid ORDER BY '. implode(', ', $order) .' LIMIT '. $limit;
+    $sql = 'SELECT n.nid, n.title, n.type, n.uid, COUNT(tn.tid) as count, ncs.comment_count FROM {node} n INNER JOIN {term_node} tn USING (nid) LEFT JOIN {node_comment_statistics} ncs USING (nid) WHERE '. implode(' AND ', $where) .' GROUP BY n.nid, n.title, n.type, n.uid, ncs.comment_count, '. implode(', ',$orderAttributes) .' ORDER BY '. implode(', ', $order) .' LIMIT '. $limit;
 
     $result = db_query($sql);
     while ($node = db_fetch_object($result)) {
