aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggEntity.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes/ElggEntity.php')
-rw-r--r--engine/classes/ElggEntity.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index 2adb322de..8a7c45648 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -237,7 +237,10 @@ abstract class ElggEntity extends ElggData implements
*/
public function getMetaData($name) {
if ((int) ($this->guid) > 0) {
- $md = get_metadata_byname($this->getGUID(), $name);
+ $md = elgg_get_metadata(array(
+ 'guid' => $this->getGUID(),
+ 'metadata_name' => $name
+ ));
} else {
if (isset($this->temp_metadata[$name])) {
return $this->temp_metadata[$name];
@@ -246,6 +249,8 @@ abstract class ElggEntity extends ElggData implements
if ($md && !is_array($md)) {
return $md->value;
+ } elseif (count($md) == 1) {
+ return $md[0]->value;
} else if ($md && is_array($md)) {
return metadata_array_to_values($md);
}