aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/tags.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/engine/lib/tags.php b/engine/lib/tags.php
index 254e81905..ccb208f98 100644
--- a/engine/lib/tags.php
+++ b/engine/lib/tags.php
@@ -110,8 +110,9 @@
//$access = get_access_list();
$query = "SELECT msvalue.string as tag, count(msvalue.id) as total ";
- $query .= "FROM {$CONFIG->dbprefix}entities e join {$CONFIG->dbprefix}metadata md on md.entity_guid = e.guid ";
- $query .= " join {$CONFIG->dbprefix}entity_subtypes subtype on subtype.id = e.subtype ";
+ $query .= "FROM {$CONFIG->dbprefix}entities e join {$CONFIG->dbprefix}metadata md on md.entity_guid = e.guid ";
+ if ($entity_subtype > 0)
+ $query .= " join {$CONFIG->dbprefix}entity_subtypes subtype on subtype.id = e.subtype ";
$query .= " join {$CONFIG->dbprefix}metastrings msvalue on msvalue.id = md.value_id ";
$query .= " where msvalue.string != '' ";