fix: Deal with DataObjects or Int values, so that the correct value is shown with has_one

This commit is contained in:
Roman Schmid 2022-06-28 09:29:32 +02:00
parent 527c5b2224
commit bc7bf5265b

View File

@ -402,6 +402,14 @@ class TagField extends MultiSelectField
return $values->column($this->getTitleField());
}
if ($values instanceof DataObject && $values->exists()) {
return [$values->ID];
}
if (is_int($values)) {
return [$values];
}
return [trim((string) $values)];
}