mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #1078 from GuySartorelli/patch-1
ENH Avoid use of 'new' keyword on injectable classes from this module.
This commit is contained in:
commit
edb3d4ca8c
@ -118,7 +118,7 @@ class UserForm extends Form
|
|||||||
*/
|
*/
|
||||||
public function getFormFields()
|
public function getFormFields()
|
||||||
{
|
{
|
||||||
$fields = new UserFormsFieldList();
|
$fields = UserFormsFieldList::create();
|
||||||
$target = $fields;
|
$target = $fields;
|
||||||
|
|
||||||
foreach ($this->controller->data()->Fields() as $field) {
|
foreach ($this->controller->data()->Fields() as $field) {
|
||||||
@ -174,7 +174,7 @@ class UserForm extends Form
|
|||||||
->filter('Required', true)
|
->filter('Required', true)
|
||||||
->column('Name');
|
->column('Name');
|
||||||
$requiredNames = array_merge($requiredNames, $this->getEmailRecipientRequiredFields());
|
$requiredNames = array_merge($requiredNames, $this->getEmailRecipientRequiredFields());
|
||||||
$required = new UserFormsRequiredFields($requiredNames);
|
$required = UserFormsRequiredFields::create($requiredNames);
|
||||||
$this->extend('updateRequiredFields', $required);
|
$this->extend('updateRequiredFields', $required);
|
||||||
$required->setForm($this);
|
$required->setForm($this);
|
||||||
return $required;
|
return $required;
|
||||||
|
Loading…
Reference in New Issue
Block a user