From e34d6e4898ff162b76e612eb39bf33a3f2e248ed Mon Sep 17 00:00:00 2001
From: Roman Schmid <bummzack@gmail.com>
Date: Mon, 4 Jul 2022 16:10:02 +0200
Subject: [PATCH] fix: Use the title-field for has_one DataObject relations

---
 src/TagField.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/TagField.php b/src/TagField.php
index 7e45d46..c8df287 100644
--- a/src/TagField.php
+++ b/src/TagField.php
@@ -403,7 +403,7 @@ class TagField extends MultiSelectField
         }
 
         if ($values instanceof DataObject && $values->exists()) {
-            return [$values->ID];
+            return [$values->getField($this->getTitleField())];
         }
 
         if (is_int($values)) {