diff --git a/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php b/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php index a8c5151..3ec4f72 100755 --- a/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php +++ b/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php @@ -7,8 +7,10 @@ namespace Drupal\views_ui\ParamConverter; +use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\ParamConverter\EntityConverter; +use Drupal\Core\ParamConverter\AdminPathConfigEntityConverter; +use Drupal\Core\Routing\AdminContext; use Symfony\Component\Routing\Route; use Drupal\Core\ParamConverter\ParamConverterInterface; use Drupal\user\SharedTempStoreFactory; @@ -30,7 +32,7 @@ * Views UI and loaded from the views temp store, but it will not touch the * value for {bar}. */ -class ViewUIConverter extends EntityConverter implements ParamConverterInterface { +class ViewUIConverter extends AdminPathConfigEntityConverter implements ParamConverterInterface { /** * Stores the tempstore factory. @@ -47,8 +49,17 @@ class ViewUIConverter extends EntityConverter implements ParamConverterInterface * @param \Drupal\user\SharedTempStoreFactory $temp_store_factory * The factory for the temp store object. */ - public function __construct(EntityManagerInterface $entity_manager, SharedTempStoreFactory $temp_store_factory) { - parent::__construct($entity_manager); + public function __construct(EntityManagerInterface $entity_manager, SharedTempStoreFactory $temp_store_factory, ConfigFactoryInterface $config_factory = NULL, AdminContext $admin_context = NULL) { + // The config factory and admin context are new arguments due to changing + // the parent. Avoid an error on updated sites by falling back to getting + // them from the container. + if (!$config_factory) { + $config_factory = \Drupal::configFactory(); + } + if (!$admin_context) { + $admin_context = \Drupal::service('router.admin_context'); + } + parent::__construct($entity_manager, $config_factory, $admin_context); $this->tempStoreFactory = $temp_store_factory; } diff --git a/core/modules/views_ui/views_ui.services.yml b/core/modules/views_ui/views_ui.services.yml index b88e64d..27fa334 100644 --- a/core/modules/views_ui/views_ui.services.yml +++ b/core/modules/views_ui/views_ui.services.yml @@ -1,7 +1,7 @@ services: paramconverter.views_ui: class: Drupal\views_ui\ParamConverter\ViewUIConverter - arguments: ['@entity.manager', '@user.shared_tempstore'] + arguments: ['@entity.manager', '@user.shared_tempstore', '@config.factory', '@router.admin_context'] tags: - { name: paramconverter, priority: 10 } lazy: true