Skip to content

Commit

Permalink
fix: Deal with DataObjects or Int values, so that the correct value i…
Browse files Browse the repository at this point in the history
…s shown with has_one
  • Loading branch information
bummzack committed Jun 28, 2022
1 parent 527c5b2 commit bc7bf52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/TagField.php
Expand Up @@ -402,6 +402,14 @@ protected function getListValues($values): array
return $values->column($this->getTitleField());
}

if ($values instanceof DataObject && $values->exists()) {
return [$values->ID];
}

if (is_int($values)) {
return [$values];
}

return [trim((string) $values)];
}

Expand Down

0 comments on commit bc7bf52

Please sign in to comment.