mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Set values on readonly/disabled fields
These field variations are not corresponding to properties on the underlying DataObject, hence need to be set manually. At the moment, Form->loadDataFrom() is never called during schema generation, so the setValue() calls are required for all fields - which is a bug in the LeftAndMain->schema() implementation.
This commit is contained in:
parent
fbae8eef90
commit
ccbbd91822
@ -263,11 +263,13 @@ class BasicFieldsTestPage extends TestPage
|
||||
$disabledField = $field->performDisabledTransformation();
|
||||
$disabledField->setTitle($disabledField->Title() . ' (disabled)');
|
||||
$disabledField->setName($disabledField->getName() . '_disabled');
|
||||
$disabledField->setValue($field->Value());
|
||||
$tabObj->insertAfter($disabledField, $field->getName());
|
||||
|
||||
$readonlyField = $field->performReadonlyTransformation();
|
||||
$readonlyField->setTitle($readonlyField->Title() . ' (readonly)');
|
||||
$readonlyField->setName($readonlyField->getName() . '_readonly');
|
||||
$readonlyField->setValue($field->Value());
|
||||
$tabObj->insertAfter($readonlyField, $field->getName());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user