From cd76f2e04fa527f156e687834c357be32ee8bf33 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 13 Sep 2017 14:29:42 +1000 Subject: [PATCH] Field definition should override magic --- modules/backend/classes/FormField.php | 2 +- modules/backend/widgets/Form.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/backend/classes/FormField.php b/modules/backend/classes/FormField.php index 4fab49b49..938b4b7eb 100644 --- a/modules/backend/classes/FormField.php +++ b/modules/backend/classes/FormField.php @@ -93,7 +93,7 @@ class FormField /** * @var bool Specifies if this field is mandatory. */ - public $required = false; + public $required = null; /** * @var bool Specify if the field is read-only or not. diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index a94264871..1e7eac331 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -699,7 +699,7 @@ class Form extends WidgetBase /* * Check model if field is required */ - if (!$field->required && $this->model && method_exists($this->model, 'isAttributeRequired')) { + if ($field->required === null && $this->model && method_exists($this->model, 'isAttributeRequired')) { $field->required = $this->model->isAttributeRequired($field->fieldName); }