=== modified file 'sites/all/modules/biblio/biblio.pages.inc'
--- sites/all/modules/biblio/biblio.pages.inc	2009-10-04 20:38:03 +0000
+++ sites/all/modules/biblio/biblio.pages.inc	2009-10-11 16:01:44 +0000
@@ -149,10 +149,12 @@
     case 'type':
       //$sortby = "ORDER BY bt.name %s, b.biblio_year DESC ";
       $sortby = "ORDER BY bt.name %s, $sort_title";
+      $selects[] = "bt.name, $sort_title";
       break;
     case 'title':
       //$sortby = "ORDER BY SUBSTRING(n.title,1,3) %s, b.biblio_year DESC ";
       $sortby = "ORDER BY $sort_title %s";
+      $selects[] = "$sort_title";
       break;
     case 'author':
       $sortby = "ORDER BY bcd.lastname %s ";
@@ -160,6 +162,7 @@
       $where['bc-auth-category'] = "bc.auth_category=1";
       $joins['bc'] = '  INNER JOIN {biblio_contributor} as bc on b.vid = bc.vid ';
       $joins['bcd'] = '  JOIN {biblio_contributor_data} as bcd on bc.cid = bcd.cid ';
+      $selects[] = "bcd.lastname";
       break;
     case 'keyword': // added msh 070808
       $sortby = "ORDER BY bkd.word %s ";
@@ -171,6 +174,7 @@
     case 'year':
     default:
       $sortby = "ORDER BY b.biblio_year %s, b.biblio_date %s";
+      $selects[] = "b.biblio_year, b.biblio_date";
   } //end switch
   if (!isset($_SESSION['biblio_filter']) || !is_array($_SESSION['biblio_filter'])) {
     $_SESSION['biblio_filter'] = array();
@@ -402,13 +406,13 @@
   }//show only published entries to everyone except admin
 
   $select = implode(', ', $selects);
-  $count_select = implode(', ', $count_selects);
+  $count_select = 'SELECT '. implode(', ', $count_selects);
   $join = implode(' ', $joins);
 
   $where_clause = count($where) > 1 ? '('. implode(') AND (', $where) .')': $where[0];
 
   $query = db_rewrite_sql("SELECT $select FROM {node} n $join  WHERE $where_clause $limit $sortby $count_limit");
-  $count_query = db_rewrite_sql("SELECT COUNT($count_select) FROM {node} n $join  WHERE $where_clause $limit $count_limit");
+  $count_query = db_rewrite_sql("SELECT COUNT(*) FROM ($count_select FROM {node} n $join  WHERE $where_clause $limit $count_limit) X");
   $_SESSION['last_biblio_query'] = $query;
   $terms[] = $sort_attrib['order']; // this is either asc or desc to be inserted into the first term of the ORDER clause
   if($sort_attrib['sort'] == 'year') $terms[] = $sort_attrib['order']; // we need any extra order term when sorting by year since there are to date terms biblio_year and biblio_date

