From 6890d412e322031f1bf46344d940356d9dd3e896 Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Tue, 21 Jun 2022 11:14:01 +0200 Subject: [PATCH] chore: use getProfileData function to get profile data --- views/default/profile/fields/field.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/views/default/profile/fields/field.php b/views/default/profile/fields/field.php index 4df903a..e5e555f 100644 --- a/views/default/profile/fields/field.php +++ b/views/default/profile/fields/field.php @@ -26,20 +26,7 @@ $shortname = $field->metadata_name; $valtype = $field->metadata_type; -$annotations = $entity->getAnnotations([ - 'annotation_names' => "profile:{$shortname}", - 'limit' => false, -]); -$values = array_map(function (ElggAnnotation $a) { - return $a->value; -}, $annotations); - -if (!$values) { - return; -} -// emulate metadata API -$value = (count($values) === 1) ? $values[0] : $values; - +$value = $entity->getProfileData($shortname); if (elgg_is_empty($value)) { return; }