diff options
| -rw-r--r-- | engine/lib/metadata.php | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 5fe854894..053e6e273 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -517,7 +517,7 @@  		if (!$count) {
  			$query = "SELECT distinct e.* "; 
  		} else {
 -			$query = "SELECT count(e.guid) as total ";
 +			$query = "SELECT count(distinct e.guid) as total ";
  		}
  		$query .= "from {$CONFIG->dbprefix}entities e JOIN {$CONFIG->dbprefix}metadata m on e.guid = m.entity_guid where"; @@ -622,7 +622,7 @@  			$where[] = "e.container_guid = {$owner_guid}";
  		if ($count) {
 -			$query = "SELECT count(e.guid) as total ";
 +			$query = "SELECT count(distinct e.guid) as total ";
  		} else {
  			$query = "SELECT distinct e.* "; 
  		}
  | 
