FIX $record->hasMethod() should be called before getting the relation

This commit is contained in:
Christopher Darling 2020-05-06 10:53:20 +01:00 committed by Dan Hensby
parent 01e7f457a6
commit c538a231b7
No known key found for this signature in database
GPG Key ID: F76D6B5FE0626A99

View File

@ -380,8 +380,6 @@ class TagField extends MultiSelectField
$titleField = $this->getTitleField();
$values = $this->Value();
/** @var Relation $relation */
$relation = $record->$name();
$ids = [];
if (!$values) {
@ -398,6 +396,9 @@ class TagField extends MultiSelectField
);
}
/** @var Relation $relation */
$relation = $record->$name();
foreach ($values as $key => $value) {
// Get or create record
$record = $this->getOrCreateTag($value);