From e01852f34b83a96b8073d16dc73c39f3666a5902 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2020 14:39:52 +0200 Subject: [PATCH] Update `required` attribute of all forms Some were missing it, some were adding it unnecessarily. Since it's now displayed what's required this needed to be streamlined. --- application/forms/Config/General/ApplicationConfigForm.php | 2 -- application/forms/Config/ResourceConfigForm.php | 1 + application/forms/Config/User/UserForm.php | 1 - application/forms/PreferenceForm.php | 2 -- .../monitoring/application/forms/Config/BackendConfigForm.php | 1 - .../monitoring/application/forms/Config/TransportConfigForm.php | 1 + modules/setup/application/forms/ModulePage.php | 1 - 7 files changed, 2 insertions(+), 7 deletions(-) diff --git a/application/forms/Config/General/ApplicationConfigForm.php b/application/forms/Config/General/ApplicationConfigForm.php index f09d39b87..00eed236b 100644 --- a/application/forms/Config/General/ApplicationConfigForm.php +++ b/application/forms/Config/General/ApplicationConfigForm.php @@ -33,7 +33,6 @@ class ApplicationConfigForm extends Form 'checkbox', 'global_show_stacktraces', array( - 'required' => true, 'value' => true, 'label' => $this->translate('Show Stacktraces'), 'description' => $this->translate( @@ -47,7 +46,6 @@ class ApplicationConfigForm extends Form 'checkbox', 'global_show_application_state_messages', array( - 'required' => true, 'value' => true, 'label' => $this->translate('Show Application State Messages'), 'description' => $this->translate( diff --git a/application/forms/Config/ResourceConfigForm.php b/application/forms/Config/ResourceConfigForm.php index fe12aca6e..1b4913775 100644 --- a/application/forms/Config/ResourceConfigForm.php +++ b/application/forms/Config/ResourceConfigForm.php @@ -243,6 +243,7 @@ class ResourceConfigForm extends ConfigForm 'force_creation', array( 'order' => 0, + 'required' => true, 'ignore' => true, 'label' => $this->translate('Force Changes'), 'description' => $this->translate('Check this box to enforce changes without connectivity validation') diff --git a/application/forms/Config/User/UserForm.php b/application/forms/Config/User/UserForm.php index e0cffb519..6605a60a2 100644 --- a/application/forms/Config/User/UserForm.php +++ b/application/forms/Config/User/UserForm.php @@ -19,7 +19,6 @@ class UserForm extends RepositoryForm 'checkbox', 'is_active', array( - 'required' => true, 'value' => true, 'label' => $this->translate('Active'), 'description' => $this->translate('Prevents the user from logging in if unchecked') diff --git a/application/forms/PreferenceForm.php b/application/forms/PreferenceForm.php index 2ceb44973..de0e3e59c 100644 --- a/application/forms/PreferenceForm.php +++ b/application/forms/PreferenceForm.php @@ -255,7 +255,6 @@ class PreferenceForm extends Form 'checkbox', 'show_stacktraces', array( - 'required' => true, 'value' => $this->getDefaultShowStacktraces(), 'label' => $this->translate('Show Stacktraces'), 'description' => $this->translate('Set whether to show an exception\'s stacktrace.') @@ -267,7 +266,6 @@ class PreferenceForm extends Form 'checkbox', 'show_benchmark', array( - 'required' => true, 'label' => $this->translate('Use benchmark') ) ); diff --git a/modules/monitoring/application/forms/Config/BackendConfigForm.php b/modules/monitoring/application/forms/Config/BackendConfigForm.php index c311bda1c..d2b7d3a8a 100644 --- a/modules/monitoring/application/forms/Config/BackendConfigForm.php +++ b/modules/monitoring/application/forms/Config/BackendConfigForm.php @@ -175,7 +175,6 @@ class BackendConfigForm extends ConfigForm 'checkbox', 'disabled', array( - 'required' => true, 'label' => $this->translate('Disable This Backend') ) ); diff --git a/modules/monitoring/application/forms/Config/TransportConfigForm.php b/modules/monitoring/application/forms/Config/TransportConfigForm.php index c68e63dbf..8067ad323 100644 --- a/modules/monitoring/application/forms/Config/TransportConfigForm.php +++ b/modules/monitoring/application/forms/Config/TransportConfigForm.php @@ -375,6 +375,7 @@ class TransportConfigForm extends ConfigForm 'force_creation', array( 'order' => 0, + 'required' => true, 'ignore' => true, 'label' => $this->translate('Force Changes'), 'description' => $this->translate( diff --git a/modules/setup/application/forms/ModulePage.php b/modules/setup/application/forms/ModulePage.php index 9857ce100..123085489 100644 --- a/modules/setup/application/forms/ModulePage.php +++ b/modules/setup/application/forms/ModulePage.php @@ -33,7 +33,6 @@ class ModulePage extends Form 'checkbox', $module->getName(), array( - 'required' => true, 'description' => $module->getDescription(), 'label' => ucfirst($module->getName()), 'value' => $module->getName() === 'monitoring' ? 1 : 0,