Commit 26dfabc3 authored by catch's avatar catch

Issue #2393765 by alexpott: Several forms should use ConfigFormBase and not FormBase

parent bf38b66f
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Installer\Form;
use Drupal\Core\Extension\ModuleInstallerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Locale\CountryManagerInterface;
use Drupal\Core\State\StateInterface;
......@@ -18,7 +18,7 @@
/**
* Provides the site configuration form.
*/
class SiteConfigureForm extends FormBase {
class SiteConfigureForm extends ConfigFormBase {
/**
* The user storage.
......
......@@ -14,7 +14,7 @@
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Extension\ThemeHandlerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\language\ConfigurableLanguageManagerInterface;
......@@ -25,7 +25,7 @@
/**
* Configure the selected language negotiation method for this site.
*/
class NegotiationConfigureForm extends FormBase {
class NegotiationConfigureForm extends ConfigFormBase {
/**
* Stores the configuration object for language.types.
......@@ -86,7 +86,8 @@ class NegotiationConfigureForm extends FormBase {
* The block storage, or NULL if not available.
*/
public function __construct(ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, BlockManagerInterface $block_manager, ThemeHandlerInterface $theme_handler, EntityStorageInterface $block_storage = NULL) {
$this->languageTypes = $config_factory->get('language.types');
parent::__construct($config_factory);
$this->languageTypes = $this->config('language.types');
$this->languageManager = $language_manager;
$this->negotiator = $negotiator;
$this->blockManager = $block_manager;
......
......@@ -6,13 +6,13 @@
namespace Drupal\system\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Form to select the administration theme.
*/
class ThemeAdminForm extends FormBase {
class ThemeAdminForm extends ConfigFormBase {
/**
* {@inheritdoc}
......@@ -50,7 +50,7 @@ public function buildForm(array $form, FormStateInterface $form_state, array $th
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
drupal_set_message($this->t('The configuration options have been saved.'));
parent::submitForm($form, $form_state);
$this->config('system.theme')->set('admin', $form_state->getValue('admin_theme'))->save();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment