diff -u b/core/modules/config/lib/Drupal/config/Form/ConfigAdminImportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigAdminImportForm.php --- b/core/modules/config/lib/Drupal/config/Form/ConfigAdminImportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigAdminImportForm.php @@ -7,6 +7,7 @@ namespace Drupal\config\Form; +use Drupal\Core\ControllerInterface; use Drupal\Core\Form\FormInterface; use Drupal\Core\Config\StorageInterface; use Drupal\Core\Lock; @@ -15,7 +16,7 @@ /** * Provides a configuration import form. */ -class ConfigAdminImportForm implements FormInterface { +class ConfigAdminImportForm implements FormInterface, ControllerInterface { /** * Stores the source storage to retrieve differences from. @@ -65,9 +66,6 @@ * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $source_storage = $this->sourceStorage; - $target_storage = $this->targetStorage; - $form['actions'] = array( '#type' => 'actions', ); @@ -76,7 +74,7 @@ '#value' => t('Import all'), ); - $source_list = $source_storage->listAll(); + $source_list = $this->sourceStorage->listAll(); if (empty($source_list)) { $form['no_changes'] = array( '#markup' => t('There is no configuration to import.'), @@ -85,7 +83,7 @@ return $form; } - $config_changes = config_sync_get_changes($source_storage, $target_storage); + $config_changes = config_sync_get_changes($this->sourceStorage, $this->targetStorage); if (empty($config_changes)) { $form['no_changes'] = array( '#markup' => t('There are no configuration changes.'), @@ -164,9 +162,8 @@ // Once a sync completes, we empty the staging directory. This prevents // changes from being accidentally overwritten by stray files getting // imported later. - $source_storage = $this->sourceStorage; - foreach ($source_storage->listAll() as $name) { - $source_storage->delete($name); + foreach ($this->sourceStorage->listAll() as $name) { + $this->sourceStorage->delete($name); } drupal_flush_all_caches();