From 5f3fadde20f6bbde6b354b37a2832bf5d8db9634 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 10 Apr 2009 10:34:06 +0000 Subject: 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 --- engine/lib/tags.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engine/lib/tags.php') 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 != '' "; -- cgit v1.2.3