From cedae77ac0d6de499b6e122c751e994dbbc215f2 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 2 May 2008 15:18:09 +0000 Subject: A fix for get_entities, which was borking if the subtype of object specified didn't exist. git-svn-id: https://code.elgg.org/elgg/trunk@632 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engine/lib/entities.php') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index c1168853e..cd06cd0be 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -829,7 +829,7 @@ $type = sanitise_string($type); $subtype = get_subtype_id($type, $subtype); - if ($subtype === false) + if ($subtype === false || $subtype === null || $subtype === 0) return false; $order_by = sanitise_string($order_by); @@ -845,7 +845,7 @@ if ($type != "") $where[] = "type='$type'"; - if ($subtype) + if ($subtype !== "") $where[] = "subtype=$subtype"; if ($owner_guid != "") { if (!is_array($owner_guid)) { @@ -874,9 +874,10 @@ if ($limit) $query .= " limit $offset, $limit"; // Add order and limit $dt = get_data($query, "entity_row_to_elggstar"); + system_message($query); return $dt; } else { - $total = get_data_row($query); + $total = get_data_row($query . "

"); return $total->total; } } -- cgit v1.2.3