aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-02 15:18:09 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-02 15:18:09 +0000
commitcedae77ac0d6de499b6e122c751e994dbbc215f2 (patch)
tree3823dddf0587ea656c4340c22f482999c3499159
parentbaca8948d6d4c741c6a7aa090a8a26c3a883b637 (diff)
downloadelgg-cedae77ac0d6de499b6e122c751e994dbbc215f2.tar.gz
elgg-cedae77ac0d6de499b6e122c751e994dbbc215f2.tar.bz2
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
-rw-r--r--engine/lib/entities.php7
1 files changed, 4 insertions, 3 deletions
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 . "<br /><br />");
return $total->total;
}
}