mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE: FormAction::FieldHolder() now returns just the Field(), so that a FieldList::forTemplate() returns a sensible result for an action list.
This commit is contained in:
parent
e4dbf8065b
commit
1fd8d19e28
@ -73,6 +73,10 @@ class FormAction extends FormField {
|
||||
);
|
||||
return $this->customise($properties)->renderWith($this->getTemplate());
|
||||
}
|
||||
|
||||
function FieldHolder() {
|
||||
return $this->Field();
|
||||
}
|
||||
|
||||
public function Type() {
|
||||
return 'action';
|
||||
|
@ -725,7 +725,20 @@ class FieldListTest extends SapphireTest {
|
||||
);
|
||||
|
||||
$this->assertEquals($a->FieldHolder() . $b->FieldHolder(), $set->forTempalte());
|
||||
}
|
||||
|
||||
/**
|
||||
* FieldList::forTemplate() for an action list returns a concatenation of Field values.
|
||||
* Internally, this works by having FormAction::FieldHolder return just the field, but it's an important
|
||||
* use-case to test.
|
||||
*/
|
||||
function testForTemplateForActionList() {
|
||||
$set = new FieldList(
|
||||
$a = new FormAction('A'),
|
||||
$b = new FormAction('B')
|
||||
);
|
||||
|
||||
$this->assertEquals($a->Field() . $b->Field(), $set->forTempalte());
|
||||
}
|
||||
|
||||
function testMakeFieldReadonly() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user