Index: xmlsitemap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/xmlsitemap/xmlsitemap.module,v
retrieving revision 1.97
diff -u -p -r1.97 xmlsitemap.module
--- xmlsitemap.module	6 Sep 2010 16:57:30 -0000	1.97
+++ xmlsitemap.module	7 Sep 2010 21:20:30 -0000
@@ -979,17 +979,14 @@ function xmlsitemap_get_link_type_indexe
   $status['indexed'] = db_query("SELECT COUNT(id) FROM {xmlsitemap} WHERE type = :entity AND subtype = :bundle", array(':entity' => $entity_type, ':bundle' => $bundle))->fetchField();
   $status['visible'] = db_query("SELECT COUNT(id) FROM {xmlsitemap} WHERE type = :entity AND subtype = :bundle AND status = 1 AND access = 1", array(':entity' => $entity_type, ':bundle' => $bundle))->fetchField();
 
-  // @todo Convert this query to a countQuery().
   $total = db_select($info['base table'], 'base');
-  $total->addExpression('COUNT(:id)', 'count_expression', array(':id' => $info['entity keys']['id']));
-  //$total->addField('base', $info['entity keys']['id']);
   $total->condition($info['entity keys']['id'], 0, '>');
   $total->addTag('xmlsitemap_link_bundle_access');
   $total->addTag('xmlsitemap_link_indexed_status');
   $total->addMetaData('entity', $entity_type);
   $total->addMetaData('bundle', $bundle);
   $total->addMetaData('entity_info', $info);
-  $status['total'] = $total->/*countQuery()->*/execute()->fetchField();
+  $status['total'] = $total->countQuery()->execute()->fetchField();
 
   return $status;
 }
