Commit def57073 authored by alexpott's avatar alexpott

Issue #2239065 by tim.plunkett | webchick: Overridden config bleeding through...

Issue #2239065 by tim.plunkett | webchick: Overridden config bleeding through to configuration forms.
parent 4ebc6224
......@@ -16,13 +16,6 @@
*/
abstract class ConfigFormBase extends FormBase {
/**
* Stores the configuration factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a \Drupal\system\ConfigFormBase object.
*
......@@ -30,7 +23,7 @@ abstract class ConfigFormBase extends FormBase {
* The factory for configuration objects.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
$this->setConfigFactory($config_factory);
}
/**
......@@ -74,10 +67,12 @@ public function submitForm(array &$form, array &$form_state) {
* configuration.
*/
protected function config($name) {
$old_state = $this->configFactory->getOverrideState();
$this->configFactory->setOverrideState(FALSE);
$config = $this->configFactory->get($name);
$this->configFactory->setOverrideState($old_state);
$config_factory = $this->configFactory();
$old_state = $config_factory->getOverrideState();
$config_factory->setOverrideState(FALSE);
$config = $config_factory->get($name);
$config_factory->setOverrideState($old_state);
return $config;
}
}
......@@ -44,9 +44,14 @@ abstract class FormBase extends DependencySerialization implements FormInterface
/**
* The config factory.
*
* This is marked private in order to force subclasses to use the
* self::config() method, which may be overridden to address specific needs
* when loading config. See \Drupal\Core\Form\ConfigFormBase::config() for an
* example of this.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
private $configFactory;
/**
* The form error handler.
......@@ -121,10 +126,22 @@ protected function translationManager() {
* A configuration object.
*/
protected function config($name) {
return $this->configFactory()->get($name);
}
/**
* Gets the config factory for this form.
*
* When accessing configuration values, use $this->config(). Only use this
* when the config factory needs to be manipulated directly.
*
* @return \Drupal\Core\Config\ConfigFactoryInterface
*/
protected function configFactory() {
if (!$this->configFactory) {
$this->configFactory = $this->container()->get('config.factory');
}
return $this->configFactory->get($name);
return $this->configFactory;
}
/**
......
......@@ -99,7 +99,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('aggregator.settings');
$config = $this->config('aggregator.settings');
// Global aggregator settings.
$form['aggregator_allowed_html_tags'] = array(
......@@ -200,7 +200,7 @@ public function validateForm(array &$form, array &$form_state) {
*/
public function submitForm(array &$form, array &$form_state) {
parent::submitForm($form, $form_state);
$config = $this->configFactory->get('aggregator.settings');
$config = $this->config('aggregator.settings');
// Let active plugins save their settings.
foreach ($this->configurableInstances as $instance) {
$instance->submitConfigurationForm($form, $form_state);
......
......@@ -8,7 +8,6 @@
namespace Drupal\block;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Language\Language;
......@@ -42,13 +41,6 @@ class BlockForm extends EntityForm {
*/
protected $languageManager;
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a BlockForm object.
*
......@@ -56,13 +48,10 @@ class BlockForm extends EntityForm {
* The entity manager.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
*/
public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) {
public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager) {
$this->storage = $entity_manager->getStorage('block');
$this->languageManager = $language_manager;
$this->configFactory = $config_factory;
}
/**
......@@ -71,8 +60,7 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('language_manager'),
$container->get('config.factory')
$container->get('language_manager')
);
}
......@@ -84,7 +72,7 @@ public function form(array $form, array &$form_state) {
// Store theme settings in $form_state for use below.
if (!$theme = $entity->get('theme')) {
$theme = $this->configFactory->get('system.theme')->get('default');
$theme = $this->config('system.theme')->get('default');
}
$form_state['block_theme'] = $theme;
......
......@@ -26,7 +26,7 @@ public function getFormId() {
*/
public function buildForm(array $form, array &$form_state) {
$types = node_type_get_names();
$config = $this->configFactory->get('book.settings');
$config = $this->config('book.settings');
$form['book_allowed_types'] = array(
'#type' => 'checkboxes',
'#title' => $this->t('Content types allowed in book outlines'),
......@@ -68,7 +68,7 @@ public function submitForm(array &$form, array &$form_state) {
// that we can save them in the correct order if node type changes.
// @see book_node_type_update().
sort($allowed_types);
$this->configFactory->get('book.settings')
$this->config('book.settings')
// Remove unchecked types.
->set('allowed_types', $allowed_types)
->set('child_type', $form_state['values']['book_child_type'])
......
<?php
/**
* @file
* Contains \Drupal\config\Tests\ConfigFormOverrideTest.
*/
namespace Drupal\config\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Tests config overrides do not appear on forms that extend ConfigFormBase.
*
* @see \Drupal\Core\Form\ConfigFormBase
*/
class ConfigFormOverrideTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'Config form overrides',
'description' => 'Tests config overrides do not appear on forms that extend ConfigFormBase.',
'group' => 'Configuration',
);
}
/**
* Tests that overrides do not affect forms.
*/
public function testFormsWithOverrides() {
$this->drupalLogin($this->drupalCreateUser(array('access administration pages', 'administer site configuration')));
$overridden_name = 'Site name global conf override';
// Set up an override.
$settings['config']['system.site']['name'] = (object) array(
'value' => $overridden_name,
'required' => TRUE,
);
$this->writeSettings($settings);
\Drupal::configFactory()->setOverrideState(TRUE);
// Test that everything on the form is the same, but that the override
// worked for the actual site name.
$this->drupalGet('admin/config/system/site-information');
$this->assertTitle('Site information | ' . $overridden_name);
$elements = $this->xpath('//input[@name="site_name"]');
$this->assertIdentical((string) $elements[0]['value'], 'Drupal');
// Submit the form and ensure the site name is not changed.
$edit = array(
'site_name' => 'Custom site name',
);
$this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
$this->assertTitle('Site information | ' . $overridden_name);
$elements = $this->xpath('//input[@name="site_name"]');
$this->assertIdentical((string) $elements[0]['value'], $edit['site_name']);
}
}
......@@ -9,7 +9,6 @@
use Drupal\config_translation\ConfigMapperManagerInterface;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\Schema\Element;
use Drupal\Core\Config\TypedConfigManager;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -101,15 +100,12 @@ abstract class ConfigTranslationFormBase extends FormBase implements BaseFormIdI
* The translation storage object.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler to invoke the alter hook.
* @param \Drupal\Core\Config\ConfigFactoryInterface
* The config factory.
*/
public function __construct(TypedConfigManager $typed_config_manager, ConfigMapperManagerInterface $config_mapper_manager, StringStorageInterface $locale_storage, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager) {
public function __construct(TypedConfigManager $typed_config_manager, ConfigMapperManagerInterface $config_mapper_manager, StringStorageInterface $locale_storage, ModuleHandlerInterface $module_handler, ConfigurableLanguageManagerInterface $language_manager) {
$this->typedConfigManager = $typed_config_manager;
$this->configMapperManager = $config_mapper_manager;
$this->localeStorage = $locale_storage;
$this->moduleHandler = $module_handler;
$this->configFactory = $config_factory;
$this->languageManager = $language_manager;
}
......@@ -122,7 +118,6 @@ public static function create(ContainerInterface $container) {
$container->get('plugin.manager.config_translation.mapper'),
$container->get('locale.storage'),
$container->get('module_handler'),
$container->get('config.factory'),
$container->get('language_manager')
);
}
......@@ -176,10 +171,11 @@ public function buildForm(array $form, array &$form_state, Request $request = NU
// Get base language configuration to display in the form before setting the
// language to use for the form. This avoids repetitively settings and
// resetting the language to get original values later.
$old_state = $this->configFactory->getOverrideState();
$this->configFactory->setOverrideState(FALSE);
$config_factory = $this->configFactory();
$old_state = $config_factory->getOverrideState();
$config_factory->setOverrideState(FALSE);
$this->baseConfigData = $this->mapper->getConfigData();
$this->configFactory->setOverrideState($old_state);
$config_factory->setOverrideState($old_state);
// Set the translation target language on the configuration factory.
$original_language = $this->languageManager->getConfigOverrideLanguage();
......@@ -198,7 +194,7 @@ public function buildForm(array $form, array &$form_state, Request $request = NU
);
foreach ($this->mapper->getConfigNames() as $name) {
$form['config_names'][$name] = array('#type' => 'container');
$form['config_names'][$name] += $this->buildConfigForm($this->typedConfigManager->get($name), $this->config($name)->get(), $this->baseConfigData[$name]);
$form['config_names'][$name] += $this->buildConfigForm($this->typedConfigManager->get($name), $config_factory->get($name)->get(), $this->baseConfigData[$name]);
}
$form['actions']['#type'] = 'actions';
......@@ -221,12 +217,13 @@ public function submitForm(array &$form, array &$form_state) {
$form_values = $form_state['values']['config_names'];
// For the form submission handling, use the raw data.
$old_state = $this->configFactory->getOverrideState();
$this->configFactory->setOverrideState(FALSE);
$config_factory = $this->configFactory();
$old_state = $config_factory->getOverrideState();
$config_factory->setOverrideState(FALSE);
foreach ($this->mapper->getConfigNames() as $name) {
// Set configuration values based on form submission and source values.
$base_config = $this->config($name);
$base_config = $config_factory->get($name);
$config_translation = $this->languageManager->getLanguageConfigOverride($this->language->id, $name);
$locations = $this->localeStorage->getLocations(array('type' => 'configuration', 'name' => $name));
......@@ -241,7 +238,7 @@ public function submitForm(array &$form, array &$form_state) {
$config_translation->save();
}
}
$this->configFactory->setOverrideState($old_state);
$config_factory->setOverrideState($old_state);
$form_state['redirect_route'] = array(
'route_name' => $this->mapper->getOverviewRoute(),
......
......@@ -8,7 +8,6 @@
namespace Drupal\contact;
use Drupal\Component\Utility\String;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Flood\FloodInterface;
......@@ -28,13 +27,6 @@ class MessageForm extends ContentEntityForm {
*/
protected $entity;
/**
* The config factory service.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The flood control mechanism.
*
......@@ -45,17 +37,14 @@ class MessageForm extends ContentEntityForm {
/**
* Constructs a MessageForm object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The factory for configuration objects.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Flood\FloodInterface $flood
* The flood control mechanism.
*/
public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, FloodInterface $flood) {
public function __construct(EntityManagerInterface $entity_manager, FloodInterface $flood) {
parent::__construct($entity_manager);
$this->configFactory = $config_factory;
$this->flood = $flood;
}
......@@ -64,7 +53,6 @@ public function __construct(ConfigFactoryInterface $config_factory, EntityManage
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('entity.manager'),
$container->get('flood')
);
......@@ -241,7 +229,7 @@ public function save(array $form, array &$form_state) {
drupal_mail('contact', 'page_autoreply', $sender->getEmail(), $language_interface->id, $params);
}
$config = $this->configFactory->get('contact.settings');
$config = $this->config('contact.settings');
$this->flood->register('contact', $config->get('flood.interval'));
if (!$message->isPersonal()) {
watchdog('contact', '%sender-name (@sender-from) sent an e-mail regarding %category.', array(
......
......@@ -18,13 +18,6 @@
*/
abstract class FilterFormatFormBase extends EntityForm {
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The entity query factory.
*
......@@ -35,13 +28,10 @@ abstract class FilterFormatFormBase extends EntityForm {
/**
* Constructs a new FilterFormatFormBase.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
* The entity query factory.
*/
public function __construct(ConfigFactoryInterface $config_factory, QueryFactory $query_factory) {
$this->configFactory = $config_factory;
public function __construct(QueryFactory $query_factory) {
$this->queryFactory = $query_factory;
}
......@@ -50,7 +40,6 @@ public function __construct(ConfigFactoryInterface $config_factory, QueryFactory
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('entity.query')
);
}
......@@ -60,7 +49,7 @@ public static function create(ContainerInterface $container) {
*/
public function form(array $form, array &$form_state) {
$format = $this->entity;
$is_fallback = ($format->id() == $this->configFactory->get('filter.settings')->get('fallback_format'));
$is_fallback = ($format->id() == $this->config('filter.settings')->get('fallback_format'));
$form['#tree'] = TRUE;
$form['#attached']['library'][] = 'filter/drupal.filter.admin';
......@@ -100,7 +89,7 @@ public function form(array $form, array &$form_state) {
// If editing an existing text format, pre-select its current permissions.
$form['roles']['#default_value'] = array_keys(filter_get_roles_by_format($format));
}
elseif ($admin_role = $this->configFactory->get('user.settings')->get('admin_role')) {
elseif ($admin_role = $this->config('user.settings')->get('admin_role')) {
// If adding a new text format and the site has an administrative role,
// pre-select that role so as to grant administrators access to the new
// text format permission by default.
......
......@@ -139,7 +139,7 @@ protected function forumParentSelect($tid, $title) {
$parent = 0;
}
$vid = $this->configFactory->get('forum.settings')->get('vocabulary');
$vid = $this->config('forum.settings')->get('vocabulary');
// @todo Inject a taxonomy service when one exists.
$children = taxonomy_get_tree($vid, $tid, NULL, TRUE);
......
......@@ -25,7 +25,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('forum.settings');
$config = $this->config('forum.settings');
$options = array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 150, 200, 250, 300, 350, 400, 500);
$form['forum_hot_topic'] = array(
......@@ -64,7 +64,7 @@ public function buildForm(array $form, array &$form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('forum.settings')
$this->config('forum.settings')
->set('topics.hot_threshold', $form_state['values']['forum_hot_topic'])
->set('topics.page_limit', $form_state['values']['forum_per_page'])
->set('topics.order', $form_state['values']['forum_order'])
......
......@@ -160,7 +160,7 @@ public function buildForm(array $form, array &$form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$config = $this->configFactory->get('language.settings');
$config = $this->config('language.settings');
foreach ($form_state['values']['settings'] as $entity_type => $entity_settings) {
foreach ($entity_settings as $bundle => $bundle_settings) {
$config->set(language_get_default_configuration_settings_key($entity_type, $bundle),
......
......@@ -171,7 +171,7 @@ public function validateForm(array &$form, array &$form_state) {
public function submitForm(array &$form, array &$form_state) {
$mappings = $form_state['mappings'];
if (!empty($mappings)) {
$config = $this->configFactory->get('language.mappings');
$config = $this->config('language.mappings');
$config->setData($mappings);
$config->save();
}
......@@ -187,7 +187,7 @@ public function submitForm(array &$form, array &$form_state) {
* The browser's langcode mapping configuration array.
*/
protected function language_get_browser_drupal_langcode_mappings() {
$config = $this->configFactory->get('language.mappings');
$config = $this->config('language.mappings');
if ($config->isNew()) {
return array();
}
......
......@@ -26,7 +26,7 @@ public function getFormId() {
* Implements \Drupal\Core\Form\FormInterface::buildForm().
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('language.negotiation');
$config = $this->config('language.negotiation');
$form['selected_langcode'] = array(
'#type' => 'language_select',
'#title' => t('Language'),
......@@ -41,7 +41,7 @@ public function buildForm(array $form, array &$form_state) {
* Implements \Drupal\Core\Form\FormInterface::submitForm().
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('language.negotiation')
$this->config('language.negotiation')
->set('selected_langcode', $form_state['values']['selected_langcode'])
->save();
......
......@@ -25,7 +25,7 @@ public function getFormId() {
* Implements \Drupal\Core\Form\FormInterface::buildForm().
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('language.negotiation');
$config = $this->config('language.negotiation');
$form['language_negotiation_session_param'] = array(
'#title' => t('Request/session parameter'),
'#type' => 'textfield',
......@@ -42,7 +42,7 @@ public function buildForm(array $form, array &$form_state) {
* Implements \Drupal\Core\Form\FormInterface::submitForm().
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('language.settings')
$this->config('language.settings')
->set('session.parameter', $form_state['values']['language_negotiation_session_param'])
->save();
......
......@@ -27,7 +27,7 @@ public function getFormId() {
*/
public function buildForm(array $form, array &$form_state) {
global $base_url;
$config = $this->configFactory->get('language.negotiation');
$config = $this->config('language.negotiation');
$form['language_negotiation_url_part'] = array(
'#title' => t('Part of the URL that determines language'),
......@@ -162,7 +162,7 @@ public function validateForm(array &$form, array &$form_state) {
*/
public function submitForm(array &$form, array &$form_state) {
// Save selected format (prefix or domain).
$this->configFactory->get('language.negotiation')
$this->config('language.negotiation')
->set('url.source', $form_state['values']['language_negotiation_url_part'])
->save();
......
......@@ -24,7 +24,7 @@ public function getFormId() {
* Implements \Drupal\Core\Form\FormInterface::buildForm().
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('locale.settings');
$config = $this->config('locale.settings');
$form['update_interval_days'] = array(
'#type' => 'radios',
......@@ -97,7 +97,7 @@ public function validateForm(array &$form, array &$form_state) {
public function submitForm(array &$form, array &$form_state) {
$values = $form_state['values'];
$config = $this->configFactory->get('locale.settings');
$config = $this->config('locale.settings');
$config->set('translation.update_interval_days', $values['update_interval_days'])->save();
$config->set('translation.use_source', $values['use_source'])->save();
......
......@@ -25,7 +25,7 @@ public function getFormId() {
* Implements \Drupal\Core\Form\FormInterface::buildForm().
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('menu_ui.settings');
$config = $this->config('menu_ui.settings');
$form['intro'] = array(
'#type' => 'item',
'#markup' => t('The Menu UI module allows on-the-fly creation of menu links in the content authoring forms. To configure these settings for a particular content type, visit the <a href="@content-types">Content types</a> page, click the <em>edit</em> link for the content type, and go to the <em>Menu settings</em> section.', array('@content-types' => url('admin/structure/types'))),
......@@ -61,7 +61,7 @@ public function buildForm(array $form, array &$form_state) {
* Implements \Drupal\Core\Form\FormInterface::submitForm().
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('menu_ui.settings')
$this->config('menu_ui.settings')
->set('main_links', $form_state['values']['menu_main_links_source'])
->set('secondary_links', $form_state['values']['menu_secondary_links_source'])
->save();
......
......@@ -25,7 +25,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('simpletest.settings');
$config = $this->config('simpletest.settings');
$form['general'] = array(
'#type' => 'details',
'#title' => $this->t('General'),
......@@ -87,7 +87,7 @@ public function buildForm(array $form, array &$form_state) {
* {@inheritdoc}
*/
public function validateForm(array &$form, array &$form_state) {
$config = $this->configFactory->get('simpletest.settings');
$config = $this->config('simpletest.settings');
// If a username was provided but a password wasn't, preserve the existing
// password.
if (!empty($form_state['values']['simpletest_httpauth_username']) && empty($form_state['values']['simpletest_httpauth_password'])) {
......@@ -107,7 +107,7 @@ public function validateForm(array &$form, array &$form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('simpletest.settings')
$this->config('simpletest.settings')
->set('clear_results', $form_state['values']['simpletest_clear_results'])
->set('verbose', $form_state['values']['simpletest_verbose'])
->set('httpauth.method', $form_state['values']['simpletest_httpauth_method'])
......
......@@ -58,7 +58,7 @@ public function getFormId() {
* Implements \Drupal\Core\Form\FormInterface::buildForm().
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('statistics.settings');
$config = $this->config('statistics.settings');
// Content counter settings.
$form['content'] = array(
......@@ -80,7 +80,7 @@ public function buildForm(array $form, array &$form_state) {
* Implements \Drupal\Core\Form\FormInterface::submitForm().
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('statistics.settings')
$this->config('statistics.settings')
->set('count_content_views', $form_state['values']['statistics_count_content_views'])
->save();
......
......@@ -71,7 +71,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('system.cron');
$config = $this->config('system.cron');
$form['description'] = array(
'#markup' => '<p>' . t('Cron takes care of running periodic tasks like checking for updates and indexing content for search.') . '</p>',
......@@ -112,7 +112,7 @@ public function buildForm(array $form, array &$form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('system.cron')
$this->config('system.cron')
->set('threshold.autorun', $form_state['values']['cron_safe_threshold'])
->save();
......
......@@ -26,7 +26,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('system.file');
$config = $this->config('system.file');
$form['file_public_path'] = array(
'#type' => 'item',
'#title' => t('Public file system path'),
......@@ -86,7 +86,7 @@ public function buildForm(array $form, array &$form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$config = $this->configFactory->get('system.file')
$config = $this->config('system.file')
->set('path.private', $form_state['values']['file_private_path'])
->set('path.temporary', $form_state['values']['file_temporary_path'])
->set('temporary_maximum_age', $form_state['values']['temporary_maximum_age']);
......
......@@ -61,7 +61,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$current_toolkit = $this->configFactory->get('system.image')->get('toolkit');
$current_toolkit = $this->config('system.image')->get('toolkit');
$form['image_toolkit'] = array(
'#type' => 'radios',
......@@ -96,7 +96,7 @@ public function buildForm(array $form, array &$form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('system.image')
$this->config('system.image')
->set('toolkit', $form_state['values']['image_toolkit'])
->save();
......
......@@ -25,7 +25,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('system.logging');
$config = $this->config('system.logging');
$form['error_level'] = array(
'#type' => 'radios',
'#title' => t('Error messages to display'),
......@@ -46,7 +46,7 @@ public function buildForm(array $form, array &$fo