mirror of
https://github.com/silverstripe/silverstripe-tagfield
synced 2024-10-22 11:05:32 +02:00
fix: Deal with DataObjects or Int values, so that the correct value is shown with has_one
This commit is contained in:
parent
527c5b2224
commit
bc7bf5265b
@ -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)];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user