aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/classes/ElggEntity.php2
-rw-r--r--engine/lib/metadata.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index 1be1d5d15..e0d46f5a7 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -294,7 +294,7 @@ abstract class ElggEntity extends ElggData implements
unset($this->temp_metadata[$name]);
foreach ($value as $v) {
if ((int) $this->guid > 0) {
- elgg_delete_metadata(array('guid' => $this->guid, 'metadata_name' => $name));
+ elgg_delete_metadata(array('guid' => $this->guid, 'metadata_name' => $name, 'limit' => 0));
$multiple = true;
if (!create_metadata($this->getGUID(), $name, $v, $value_type,
$this->getOwnerGUID(), $this->getAccessID(), $multiple)) {
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index c05e0b161..230bce50f 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -135,7 +135,7 @@ function create_metadata($entity_guid, $name, $value, $value_type, $owner_guid,
if (elgg_trigger_event('create', 'metadata', $obj)) {
return $id;
} else {
- delete_metadata($id);
+ elgg_delete_metadata_by_id($id);
}
}
}
@@ -219,7 +219,7 @@ function update_metadata($id, $name, $value, $value_type, $owner_guid, $access_i
if (elgg_trigger_event('update', 'metadata', $obj)) {
return true;
} else {
- delete_metadata($id);
+ elgg_delete_metadata_by_id($id);
}
}