Skip to content

Commit

Permalink
fix(actorsfield): prevent error when computing tooltip
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 17, 2021
1 parent f054bbc commit 2d1b85d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions inc/field/actorfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,15 @@ public function getValueForDesign(): string {

public function getValueForTargetText($domain, $richText): ?string {
$value = [];
foreach ($this->value as $item) {
if (filter_var($item, FILTER_VALIDATE_EMAIL) !== false) {
$value[] = $item;
} else {
$user = new User();
$user->getFromDB($item);
$value[] = $user->getFriendlyName();
if (is_array($this->value)) {
foreach ($this->value as $item) {
if (filter_var($item, FILTER_VALIDATE_EMAIL) !== false) {
$value[] = $item;
} else {
$user = new User();
$user->getFromDB($item);
$value[] = $user->getFriendlyName();
}
}
}

Expand Down

0 comments on commit 2d1b85d

Please sign in to comment.