Skip to content

Commit

Permalink
chore: use getProfileData function to get profile data
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Jun 21, 2022
1 parent 252eb17 commit 6890d41
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions views/default/profile/fields/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6890d41

Please sign in to comment.