FIX Explicitly get the Fields() method from controller's data record

This commit is contained in:
Robbie Averill 2017-11-01 11:43:53 +13:00
parent 1a9e8325da
commit 1643b1a689
2 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -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');