mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
FIX Explicitly get the Fields() method from controller's data record
This commit is contained in:
parent
1a9e8325da
commit
1643b1a689
@ -166,9 +166,9 @@ class UserDefinedFormController extends PageController
|
||||
|
||||
$watch = [];
|
||||
|
||||
if ($this->Fields()) {
|
||||
if ($this->data()->Fields()) {
|
||||
/** @var EditableFormField $field */
|
||||
foreach ($this->Fields() as $field) {
|
||||
foreach ($this->data()->Fields() as $field) {
|
||||
if ($result = $field->formatDisplayRules()) {
|
||||
$watch[] = $result;
|
||||
}
|
||||
@ -216,7 +216,7 @@ JS
|
||||
$attachments = array();
|
||||
$submittedFields = ArrayList::create();
|
||||
|
||||
foreach ($this->Fields() as $field) {
|
||||
foreach ($this->data()->Fields() as $field) {
|
||||
if (!$field->showInReports()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ class UserForm extends Form
|
||||
$fields = new UserFormsFieldList();
|
||||
$target = $fields;
|
||||
|
||||
foreach ($this->controller->Fields() as $field) {
|
||||
foreach ($this->controller->data()->Fields() as $field) {
|
||||
$target = $target->processNext($field);
|
||||
}
|
||||
$fields->clearEmptySteps();
|
||||
@ -170,6 +170,7 @@ class UserForm extends Form
|
||||
// Generate required field validator
|
||||
$requiredNames = $this
|
||||
->getController()
|
||||
->data()
|
||||
->Fields()
|
||||
->filter('Required', true)
|
||||
->column('Name');
|
||||
|
Loading…
Reference in New Issue
Block a user