aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes')
-rw-r--r--engine/classes/ElggMetadata.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/classes/ElggMetadata.php b/engine/classes/ElggMetadata.php
index f85bac6ce..135c17028 100644
--- a/engine/classes/ElggMetadata.php
+++ b/engine/classes/ElggMetadata.php
@@ -29,15 +29,15 @@ class ElggMetadata extends ElggExtender {
// Create from db row
if ($id instanceof stdClass) {
$metadata = $id;
- } else {
- $metadata = elgg_get_metadata_from_id($id);
- }
-
- if ($metadata) {
+
$objarray = (array) $metadata;
foreach ($objarray as $key => $value) {
$this->attributes[$key] = $value;
}
+ } else {
+ // get an ElggMetadata object and copy its attributes
+ $metadata = elgg_get_metadata_from_id($id);
+ $this->attributes = $metadata->attributes;
}
}
}