aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-07 16:18:45 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-07 16:18:45 +0000
commit0945f262bf45c4277c65bd38db52e0d1ea3211c7 (patch)
tree0229a727a86326d2ad2f657cbdd00acbb5bdfdaf /engine
parent31c43df39133b5dc32bced11260ce3f2c4c7d6d8 (diff)
downloadelgg-0945f262bf45c4277c65bd38db52e0d1ea3211c7.tar.gz
elgg-0945f262bf45c4277c65bd38db52e0d1ea3211c7.tar.bz2
Further annotation / metadata fixes
git-svn-id: https://code.elgg.org/elgg/trunk@419 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/annotations.php3
-rw-r--r--engine/lib/metadata.php1
2 files changed, 1 insertions, 3 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index d671e544b..dc37cb665 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -221,7 +221,7 @@
$entity_type = sanitise_string($entity_type);
$entity_subtype = get_subtype_id($entity_type, $entity_subtype);
$name = get_metastring_id($name);
- $value = get_metastring_id($value);
+ if ($value != "") $value = get_metastring_id($value);
$owner_guid = (int)$owner_guid;
$limit = (int)$limit;
$offset = (int)$offset;
@@ -254,7 +254,6 @@
$query .= " $w and ";
$query .= " (a.access_id in {$access} or (a.access_id = 0 and a.owner_guid = {$_SESSION['id']}))"; // Add access controls
$query .= " order by $order_by limit $offset,$limit"; // Add order and limit
-
return get_data($query, "row_to_elggannotation");
}
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 3b84d3575..41ab51ac1 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -267,7 +267,6 @@
$meta_name = get_metastring_id($meta_name);
$entity_guid = (int)$entity_guid;
$access = get_access_list();
-
$result = get_data("SELECT m.*, n.string as name, v.string as value from {$CONFIG->dbprefix}metadata m JOIN {$CONFIG->dbprefix}metastrings v on m.value_id = v.id JOIN {$CONFIG->dbprefix}metastrings n on m.name_id = n.id where m.entity_guid=$entity_guid and m.name_id='$meta_name' and (m.access_id in {$access} or (m.access_id = 0 and m.owner_guid = {$_SESSION['id']}))", "row_to_elggmetadata");
if (!$result)
return false;