mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
FIX: Change creation of CreatedField to unchained as setName() method of DatetimeField is not chainable
This commit is contained in:
parent
8dc36df7a4
commit
450ed93f36
@ -570,14 +570,15 @@ class Comment extends DataObject {
|
|||||||
_t('Comment.ParentComment_Title', 'This comment is a reply to the below')
|
_t('Comment.ParentComment_Title', 'This comment is a reply to the below')
|
||||||
));
|
));
|
||||||
// Created date
|
// Created date
|
||||||
$fields->push(
|
// FIXME - the method setName in DatetimeField is not chainable, hence
|
||||||
$parent
|
// the lack of chaining here
|
||||||
|
$createdField = $parent
|
||||||
->obj('Created')
|
->obj('Created')
|
||||||
->scaffoldFormField($parent->fieldLabel('Created'))
|
->scaffoldFormField($parent->fieldLabel('Created'));
|
||||||
->setName('ParentComment_Created')
|
$createdField->setName('ParentComment_Created');
|
||||||
->setValue($parent->Created)
|
$createdField->setValue($parent->Created);
|
||||||
->performReadonlyTransformation()
|
$createdField->performReadonlyTransformation();
|
||||||
);
|
$fields->push($createdField);
|
||||||
|
|
||||||
// Name (could be member or string value)
|
// Name (could be member or string value)
|
||||||
$fields->push(
|
$fields->push(
|
||||||
|
Loading…
Reference in New Issue
Block a user