diff --git a/src/StringTagField.php b/src/StringTagField.php index 78d4442..4cc1c04 100644 --- a/src/StringTagField.php +++ b/src/StringTagField.php @@ -173,7 +173,7 @@ public function getSchemaDataDefaults() 'lazyLoad' => $this->getShouldLazyLoad(), 'creatable' => $this->getCanCreate(), 'multi' => $this->getIsMultiple(), - 'value' => $this->formatOptions($this->Value()), + 'value' => $this->formatOptions($this->getFormattedValue()), 'disabled' => $this->isDisabled() || $this->isReadonly(), ] ); @@ -384,7 +384,7 @@ public function setCanCreate($canCreate) public function performReadonlyTransformation() { $field = parent::performReadonlyTransformation(); - $field->setValue(implode(', ', $this->Value())); + $field->setValue(implode(', ', $this->getFormattedValue())); return $field; } } diff --git a/tests/StringTagFieldTest.php b/tests/StringTagFieldTest.php index 1a766c2..efadf92 100755 --- a/tests/StringTagFieldTest.php +++ b/tests/StringTagFieldTest.php @@ -140,18 +140,18 @@ public function testPerformReadonlyTransformation() // Ensure a single value can be rendered $field->setValue(['Test2']); $field_readonly = $field->performReadonlyTransformation(); - $this->assertEquals('Test2', $field_readonly->Value()); + $this->assertEquals('Test2', $field_readonly->getFormattedValue()); // Ensure multiple valid values are rendered $field->setValue(['Test1', 'Test2']); $field_readonly = $field->performReadonlyTransformation(); - $this->assertEquals('Test1, Test2', $field_readonly->Value()); + $this->assertEquals('Test1, Test2', $field_readonly->getFormattedValue()); // Ensure an value not in the source array is still rendered // (because e.g. in history view it must have been a valid value when it was set) $field->setValue(['Test', 'Test1']); $field_readonly = $field->performReadonlyTransformation(); - $this->assertEquals('Test, Test1', $field_readonly->Value()); + $this->assertEquals('Test, Test1', $field_readonly->getFormattedValue()); } /** diff --git a/tests/TagFieldTest.php b/tests/TagFieldTest.php index 0513b61..6a348b2 100755 --- a/tests/TagFieldTest.php +++ b/tests/TagFieldTest.php @@ -337,7 +337,7 @@ public function testItDisplaysValuesFromRelations() $ids = TagFieldTestBlogTag::get()->column('ID'); - $this->assertEquals($field->Value(), $ids); + $this->assertEquals($field->getValue(), $ids); } public function testItIgnoresNewTagsIfCannotCreate()