diff --git a/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php index b85ca2c..c5fd4e6 100644 --- a/core/modules/aggregator/src/Controller/AggregatorController.php +++ b/core/modules/aggregator/src/Controller/AggregatorController.php @@ -174,9 +174,6 @@ public function pageLast() { $items = $this->entityManager()->getStorage('aggregator_item')->loadAll(20); $build = $this->buildPageList($items); - $config = $this->config('system.site'); - $build['#cache']['tags'] = $config->getCacheTags(); - $build['#attached']['feed'][] = array('aggregator/rss', $this->config('system.site')->get('name') . ' ' . $this->t('aggregator')); return $build; } diff --git a/core/modules/block/src/BlockForm.php b/core/modules/block/src/BlockForm.php index 8a204ed..3ff21f6 100644 --- a/core/modules/block/src/BlockForm.php +++ b/core/modules/block/src/BlockForm.php @@ -10,7 +10,6 @@ use Drupal\block\Event\BlockContextEvent; use Drupal\block\Event\BlockEvents; use Drupal\Component\Utility\Html; -use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\EntityForm; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Executable\ExecutableManagerInterface; @@ -109,11 +108,10 @@ public static function create(ContainerInterface $container) { */ public function form(array $form, FormStateInterface $form_state) { $entity = $this->entity; - $config = $this->config('system.theme'); // Store theme settings in $form_state for use below. if (!$theme = $entity->getTheme()) { - $theme = $config->get('default'); + $theme = $this->config('system.theme')->get('default'); } $form_state->set('block_theme', $theme); diff --git a/core/modules/book/src/Form/BookSettingsForm.php b/core/modules/book/src/Form/BookSettingsForm.php index dc05eb8..0db0dc5 100644 --- a/core/modules/book/src/Form/BookSettingsForm.php +++ b/core/modules/book/src/Form/BookSettingsForm.php @@ -7,7 +7,6 @@ namespace Drupal\book\Form; -use Drupal\Core\Cache\Cache; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; diff --git a/core/modules/contact/src/ContactFormEditForm.php b/core/modules/contact/src/ContactFormEditForm.php index 4319abe..cc76152 100644 --- a/core/modules/contact/src/ContactFormEditForm.php +++ b/core/modules/contact/src/ContactFormEditForm.php @@ -7,7 +7,6 @@ namespace Drupal\contact; -use Drupal\Core\Cache\Cache; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityForm; use Drupal\Core\Entity\EntityTypeInterface; @@ -35,8 +34,7 @@ public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); $contact_form = $this->entity; - $config = $this->config('contact.settings'); - $default_form = $config->get('default_form'); + $default_form = $this->config('contact.settings')->get('default_form'); $form['label'] = array( '#type' => 'textfield', diff --git a/core/modules/language/src/Form/NegotiationSelectedForm.php b/core/modules/language/src/Form/NegotiationSelectedForm.php index 4b212b7..57194f9 100644 --- a/core/modules/language/src/Form/NegotiationSelectedForm.php +++ b/core/modules/language/src/Form/NegotiationSelectedForm.php @@ -7,7 +7,6 @@ namespace Drupal\language\Form; -use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Form\ConfigFormBase; @@ -42,7 +41,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#languages' => LanguageInterface::STATE_CONFIGURABLE | LanguageInterface::STATE_SITE_DEFAULT, '#default_value' => $config->get('selected_langcode'), ); - $form['#cache']['tags'] = Cache::mergeTags(isset($form['#cache']['tags']) ? $form['#cache']['tags'] : [], $config->getCacheTags()); return parent::buildForm($form, $form_state); } diff --git a/core/modules/language/src/Form/NegotiationUrlForm.php b/core/modules/language/src/Form/NegotiationUrlForm.php index dea6aba..fa1cd3e 100644 --- a/core/modules/language/src/Form/NegotiationUrlForm.php +++ b/core/modules/language/src/Form/NegotiationUrlForm.php @@ -7,7 +7,6 @@ namespace Drupal\language\Form; -use Drupal\Core\Cache\Cache; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageManagerInterface; @@ -132,8 +131,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form_state->setRedirect('language.negotiation'); - $form['#cache']['tags'] = Cache::mergeTags(isset($form['#cache']['tags']) ? $form['#cache']['tags'] : [], $config->getCacheTags()); - return parent::buildForm($form, $form_state); } diff --git a/core/modules/locale/src/Form/LocaleSettingsForm.php b/core/modules/locale/src/Form/LocaleSettingsForm.php index 7685eb3..64460cc 100644 --- a/core/modules/locale/src/Form/LocaleSettingsForm.php +++ b/core/modules/locale/src/Form/LocaleSettingsForm.php @@ -6,7 +6,6 @@ namespace Drupal\locale\Form; -use Drupal\Core\Cache\Cache; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; @@ -86,8 +85,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#description' => $this->t('How to treat existing translations when automatically updating the interface translations.'), ); - $form['#cache']['tags'] = Cache::mergeTags(isset($form['#cache']['tags']) ? $form['#cache']['tags'] : [], $config->getCacheTags()); - return parent::buildForm($form, $form_state); } diff --git a/core/modules/search/src/Controller/SearchController.php b/core/modules/search/src/Controller/SearchController.php index a78a11b..f3e0e06 100644 --- a/core/modules/search/src/Controller/SearchController.php +++ b/core/modules/search/src/Controller/SearchController.php @@ -7,7 +7,6 @@ namespace Drupal\search\Controller; -use Drupal\Core\Cache\Cache; use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Controller\ControllerBase; use Drupal\search\SearchPageInterface; @@ -90,9 +89,7 @@ public function view(Request $request, SearchPageInterface $entity) { if ($request->query->has('keys')) { if ($plugin->isSearchExecutable()) { // Log the search. - $config = $this->config('search.settings'); - $build['#cache']['tags'] = Cache::mergeTags(isset($build['#cache']['tags']) ? $build['#cache']['tags'] : [], $config->getCacheTags()); - if ($config->get('logging')) { + if ($this->config('search.settings')->get('logging')) { $this->logger->notice('Searched %type for %keys.', array('%keys' => $keys, '%type' => $entity->label())); } diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php index 2323fe7..daa2868 100644 --- a/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -7,7 +7,6 @@ namespace Drupal\taxonomy; -use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\ContentEntityForm; use Drupal\Core\Form\FormStateInterface; @@ -23,7 +22,6 @@ public function form(array $form, FormStateInterface $form_state) { $term = $this->entity; $vocab_storage = $this->entityManager->getStorage('taxonomy_vocabulary'); $vocabulary = $vocab_storage->load($term->bundle()); - $config = $this->config('taxonomy.settings'); $parent = array_keys(taxonomy_term_load_parents($term->id())); $form_state->set(['taxonomy', 'parent'], $parent); @@ -40,7 +38,7 @@ public function form(array $form, FormStateInterface $form_state) { // numbers of items so we check for taxonomy.settings:override_selector // before loading the full vocabulary. Contrib modules can then intercept // before hook_form_alter to provide scalable alternatives. - if (!$config->get('override_selector')) { + if (!$this->config('taxonomy.settings')->get('override_selector')) { $parent = array_keys(taxonomy_term_load_parents($term->id())); $children = taxonomy_get_tree($vocabulary->id(), $term->id()); @@ -90,8 +88,6 @@ public function form(array $form, FormStateInterface $form_state) { '#value' => $term->id(), ); - $form['#cache']['tags'] = Cache::mergeTags(isset($form['#cache']['tags']) ? $form['#cache']['tags'] : [], $config->getCacheTags()); - return parent::form($form, $form_state, $term); } diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php index 3bb8779..7ed3cbd 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -74,7 +74,6 @@ public function form(array $form, FormStateInterface $form_state) { $account = $this->entity; $user = $this->currentUser(); $config = \Drupal::config('user.settings'); - $form['#cache']['tags'] = $config->getCacheTags(); $language_interface = \Drupal::languageManager()->getCurrentLanguage(); $register = $account->isAnonymous(); diff --git a/core/modules/user/src/Form/UserCancelForm.php b/core/modules/user/src/Form/UserCancelForm.php index 1626457..0297e70 100644 --- a/core/modules/user/src/Form/UserCancelForm.php +++ b/core/modules/user/src/Form/UserCancelForm.php @@ -7,7 +7,6 @@ namespace Drupal\user\Form; -use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\ContentEntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; @@ -77,7 +76,6 @@ public function getConfirmText() { public function buildForm(array $form, FormStateInterface $form_state) { $user = $this->currentUser(); $this->cancelMethods = user_cancel_methods(); - $config = $this->config('user.settings'); // Display account cancellation method selection, if allowed. $admin_access = $user->hasPermission('administer users'); @@ -100,7 +98,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#description' => $this->t('When enabled, the user must confirm the account cancellation via email.'), ); // Also allow to send account canceled notification mail, if enabled. - $default_notify = $config->get('notify.status_canceled'); + $default_notify = $this->config('user.settings')->get('notify.status_canceled'); $form['user_cancel_notify'] = array( '#type' => 'checkbox', '#title' => $this->t('Notify user when account is canceled'), @@ -114,8 +112,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); - $form['#cache']['tags'] = Cache::mergeTags(isset($form['#cache']['tags']) ? $form['#cache']['tags'] : [], $config->getCacheTags()); - return $form; } diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 7cc10be..76d26fc 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -607,40 +607,3 @@ # if (file_exists(__DIR__ . '/settings.local.php')) { # include __DIR__ . '/settings.local.php'; # } - -/** - * Trusted host configuration. - * - * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host - * header spoofing. - * - * To enable the trusted host mechanism, you enable your allowable hosts - * in $settings['trusted_host_patterns']. This should be an array of regular - * expression patterns, without delimiters, representing the hosts you would - * like to allow. - * - * For example: - * @code - * $settings['trusted_host_patterns'] = array( - * '^www\.example\.com$', - * ); - * @endcode - * will allow the site to only run from www.example.com. - * - * If you are running multisite, or if you are running your site from - * different domain names (eg, you don't redirect http://www.example.com to - * http://example.com), you should specify all of the host patterns that are - * allowed by your site. - * - * For example: - * @code - * $settings['trusted_host_patterns'] = array( - * '^example\.com$', - * '^.+\.example\.com$', - * '^example\.org', - * '^.+\.example\.org', - * ); - * @endcode - * will allow the site to run off of all variants of example.com and - * example.org, with all subdomains included. - */