aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-10 10:34:06 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-10 10:34:06 +0000
commit5f3fadde20f6bbde6b354b37a2832bf5d8db9634 (patch)
tree510ca7cb7137393f7c03482d26ab00cfc35ca3af /engine
parent01d229aa16f6514da35701ff0a811f592be6ef97 (diff)
downloadelgg-5f3fadde20f6bbde6b354b37a2832bf5d8db9634.tar.gz
elgg-5f3fadde20f6bbde6b354b37a2832bf5d8db9634.tar.bz2
Closes #977: get_tags now functional for entities without subtypes.
git-svn-id: https://code.elgg.org/elgg/trunk@3202 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-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 != '' ";