diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php index b97218b..3ff2f00 100644 --- a/core/modules/config/src/Form/ConfigSync.php +++ b/core/modules/config/src/Form/ConfigSync.php @@ -7,11 +7,9 @@ namespace Drupal\config\Form; -use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\ConfigImporterException; use Drupal\Core\Config\ConfigImporter; use Drupal\Core\Config\TypedConfigManagerInterface; -use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleInstallerInterface; use Drupal\Core\Extension\ThemeHandlerInterface; @@ -21,6 +19,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Lock\LockBackendInterface; use Drupal\Core\Config\StorageComparer; +use Drupal\Core\Render\RendererInterface; use Drupal\Core\Url; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -101,6 +100,13 @@ class ConfigSync extends FormBase { protected $moduleInstaller; /** + * The rendering service. + * + * @var \Drupal\Core\Render\RendererInterface + */ + protected $renderer; + + /** * Constructs the object. * * @param \Drupal\Core\Config\StorageInterface $staging_storage @@ -123,8 +129,10 @@ class ConfigSync extends FormBase { * The module installer. * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler + * @param \Drupal\Core\Render\RendererInterface $render + * The rendering service. */ - public function __construct(StorageInterface $staging_storage, StorageInterface $active_storage, StorageInterface $snapshot_storage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler) { + public function __construct(StorageInterface $staging_storage, StorageInterface $active_storage, StorageInterface $snapshot_storage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler, RendererInterface $renderer) { $this->stagingStorage = $staging_storage; $this->activeStorage = $active_storage; $this->snapshotStorage = $snapshot_storage; @@ -135,6 +143,7 @@ public function __construct(StorageInterface $staging_storage, StorageInterface $this->moduleHandler = $module_handler; $this->moduleInstaller = $module_installer; $this->themeHandler = $theme_handler; + $this->renderer = $renderer; } /** @@ -151,7 +160,8 @@ public static function create(ContainerInterface $container) { $container->get('config.typed'), $container->get('module_handler'), $container->get('module_installer'), - $container->get('theme_handler') + $container->get('theme_handler'), + $container->get('renderer') ); } @@ -185,7 +195,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#theme' => 'item_list', '#items' => $change_list, ); - $change_list_html = drupal_render($change_list_render); + $change_list_html = $this->renderer->render($change_list_render); drupal_set_message($this->t('Your current configuration has changed. Changes to these configuration items will be lost on the next synchronization: !changes', array('!changes' => $change_list_html)), 'warning'); } } @@ -401,5 +411,4 @@ public static function finishBatch($success, $results, $operations) { } } - }