Merge remote-tracking branch 'origin/2.4' into pulls/fix-react

This commit is contained in:
Damian Mooyman 2020-07-06 14:18:12 +12:00
commit 5decfa39e1
No known key found for this signature in database
GPG Key ID: 19B1752E86A700BB
2 changed files with 8 additions and 0 deletions

View File

@ -532,6 +532,8 @@ class TagField extends MultiSelectField
/** @var ReadonlyTagField $copy */
$copy = $this->castedCopy(ReadonlyTagField::class);
$copy->setSourceList($this->getSourceList());
$copy->setTitleField($this->getTitleField());
return $copy;
}

View File

@ -376,6 +376,12 @@ class TagFieldTest extends SapphireTest
$field = new TagField('Tags', '', TagFieldTestBlogTag::get());
$readOnlyField = $field->performReadonlyTransformation();
$this->assertInstanceOf(ReadonlyTagField::class, $readOnlyField);
// Custom title field
$field = new TagField('Tags', '', TagFieldTestBlogTag::get());
$field->setTitleField('Name');
$readOnlyField = $field->performReadonlyTransformation();
$this->assertEquals('Name', $readOnlyField->getTitleField());
}
public function testGetSchemaDataDefaults()