aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggMetadata.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 17:48:45 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 17:48:45 +0000
commit5919c4539e5602aaaeb82ed64373d0500dc4911f (patch)
tree3549b96e7f6860346833504b5d1bc37aec033253 /engine/classes/ElggMetadata.php
parentaedc7ea1f86b9fd33f83c71f3e3de2f317b933d6 (diff)
downloadelgg-5919c4539e5602aaaeb82ed64373d0500dc4911f.tar.gz
elgg-5919c4539e5602aaaeb82ed64373d0500dc4911f.tar.bz2
Fixes #3246 fixed ElggMetadata() constructor
git-svn-id: http://code.elgg.org/elgg/trunk@8849 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggMetadata.php')
-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;
}
}
}