diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-03-31 12:18:16 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-03-31 12:18:16 +0000 |
commit | a0a6ed1d1bcececefbff00158f9fa6ad0790ed16 (patch) | |
tree | 733bcafc1020348e0143bf766d757f2203d05e12 /engine/lib/metadata.php | |
parent | e484463d7c1ab37fd024c7ae8ce5ecf3c47041d7 (diff) | |
download | elgg-a0a6ed1d1bcececefbff00158f9fa6ad0790ed16.tar.gz elgg-a0a6ed1d1bcececefbff00158f9fa6ad0790ed16.tar.bz2 |
Closes #896: Error thrown if user not validate. Metadata physically removed rather than simply blanked when validation is requested.
Note: update_metadata no longer seems to support anonymous metadata which is likely to have knock on issues elsewhere...
git-svn-id: https://code.elgg.org/elgg/trunk@3184 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r-- | engine/lib/metadata.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 8a19d847a..35ea073f0 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -216,7 +216,7 @@ $existing = get_data_row("SELECT * from {$CONFIG->dbprefix}metadata WHERE entity_guid = $entity_guid and name_id=" . add_metastring($name) . " limit 1");
if (($existing) && (!$allow_multiple) && (isset($value)))
- {
+ {
$id = $existing->id;
$result = update_metadata($id, $name, $value, $value_type, $owner_guid, $access_id);
@@ -256,7 +256,7 @@ $id = $existing->id;
delete_metadata($id);
- }
+ } return $id;
}
@@ -279,7 +279,7 @@ if (!$md = get_metadata($id)) return false;
if (!$md->canEdit()) return false;
-
+
// If memcached then we invalidate the cache for this entry
static $metabyname_memcache;
if ((!$metabyname_memcache) && (is_memcache_available()))
@@ -311,8 +311,8 @@ $name = add_metastring($name);
if (!$name) return false;
-
- // If ok then add it
+ + // If ok then add it
$result = update_data("UPDATE {$CONFIG->dbprefix}metadata set value_id='$value', value_type='$value_type', access_id=$access_id, owner_guid=$owner_guid where id=$id and name_id='$name'");
if ($result!==false) {
$obj = get_metadata($id);
|