summaryrefslogtreecommitdiffstats
path: root/core/modules/views_ui
diff options
context:
space:
mode:
authorNathaniel Catchpole2018-01-12 10:04:36 (GMT)
committerNathaniel Catchpole2018-01-12 10:04:36 (GMT)
commit601593f06efc32cb96aa1a8779d0ecd690586bbc (patch)
tree9e54896fe557527dfe516b09647efdb6edff537c /core/modules/views_ui
parente965387d6f8c082cbf4fb2b710c70f6cdc70929d (diff)
Issue #2935617 by alexpott, chr.fritsch: Move User module's temp stores to core
Diffstat (limited to 'core/modules/views_ui')
-rw-r--r--core/modules/views_ui/src/Form/BreakLockForm.php10
-rw-r--r--core/modules/views_ui/src/ParamConverter/ViewUIConverter.php6
-rw-r--r--core/modules/views_ui/src/ViewEditForm.php8
-rw-r--r--core/modules/views_ui/src/ViewUI.php6
-rw-r--r--core/modules/views_ui/tests/src/Functional/CachedDataUITest.php8
-rw-r--r--core/modules/views_ui/views_ui.services.yml2
6 files changed, 20 insertions, 20 deletions
diff --git a/core/modules/views_ui/src/Form/BreakLockForm.php b/core/modules/views_ui/src/Form/BreakLockForm.php
index 464920b..6e93848 100644
--- a/core/modules/views_ui/src/Form/BreakLockForm.php
+++ b/core/modules/views_ui/src/Form/BreakLockForm.php
@@ -5,7 +5,7 @@ namespace Drupal\views_ui\Form;
use Drupal\Core\Entity\EntityConfirmFormBase;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\user\SharedTempStoreFactory;
+use Drupal\Core\TempStore\SharedTempStoreFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
@@ -23,9 +23,9 @@ class BreakLockForm extends EntityConfirmFormBase {
protected $entityManager;
/**
- * Stores the user tempstore.
+ * Stores the shared tempstore.
*
- * @var \Drupal\user\SharedTempStore
+ * @var \Drupal\Core\TempStore\SharedTempStore
*/
protected $tempStore;
@@ -34,7 +34,7 @@ class BreakLockForm extends EntityConfirmFormBase {
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The Entity manager.
- * @param \Drupal\user\SharedTempStoreFactory $temp_store_factory
+ * @param \Drupal\Core\TempStore\SharedTempStoreFactory $temp_store_factory
* The factory for the temp store object.
*/
public function __construct(EntityManagerInterface $entity_manager, SharedTempStoreFactory $temp_store_factory) {
@@ -48,7 +48,7 @@ class BreakLockForm extends EntityConfirmFormBase {
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
- $container->get('user.shared_tempstore')
+ $container->get('tempstore.shared')
);
}
diff --git a/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php b/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php
index ad718ba..fb19d18 100644
--- a/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php
+++ b/core/modules/views_ui/src/ParamConverter/ViewUIConverter.php
@@ -8,7 +8,7 @@ use Drupal\Core\ParamConverter\AdminPathConfigEntityConverter;
use Drupal\Core\Routing\AdminContext;
use Symfony\Component\Routing\Route;
use Drupal\Core\ParamConverter\ParamConverterInterface;
-use Drupal\user\SharedTempStoreFactory;
+use Drupal\Core\TempStore\SharedTempStoreFactory;
use Drupal\views_ui\ViewUI;
/**
@@ -32,7 +32,7 @@ class ViewUIConverter extends AdminPathConfigEntityConverter implements ParamCon
/**
* Stores the tempstore factory.
*
- * @var \Drupal\user\SharedTempStoreFactory
+ * @var \Drupal\Core\TempStore\SharedTempStoreFactory
*/
protected $tempStoreFactory;
@@ -41,7 +41,7 @@ class ViewUIConverter extends AdminPathConfigEntityConverter implements ParamCon
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
- * @param \Drupal\user\SharedTempStoreFactory $temp_store_factory
+ * @param \Drupal\Core\TempStore\SharedTempStoreFactory $temp_store_factory
* The factory for the temp store object.
*/
public function __construct(EntityManagerInterface $entity_manager, SharedTempStoreFactory $temp_store_factory, ConfigFactoryInterface $config_factory = NULL, AdminContext $admin_context = NULL) {
diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php
index 9c1d58a..cea587e 100644
--- a/core/modules/views_ui/src/ViewEditForm.php
+++ b/core/modules/views_ui/src/ViewEditForm.php
@@ -11,7 +11,7 @@ use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\ElementInfoManagerInterface;
use Drupal\Core\Url;
-use Drupal\user\SharedTempStoreFactory;
+use Drupal\Core\TempStore\SharedTempStoreFactory;
use Drupal\views\Views;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
@@ -27,7 +27,7 @@ class ViewEditForm extends ViewFormBase {
/**
* The views temp store.
*
- * @var \Drupal\user\SharedTempStore
+ * @var \Drupal\Core\TempStore\SharedTempStore
*/
protected $tempStore;
@@ -55,7 +55,7 @@ class ViewEditForm extends ViewFormBase {
/**
* Constructs a new ViewEditForm object.
*
- * @param \Drupal\user\SharedTempStoreFactory $temp_store_factory
+ * @param \Drupal\Core\TempStore\SharedTempStoreFactory $temp_store_factory
* The factory for the temp store object.
* @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
* The request stack object.
@@ -76,7 +76,7 @@ class ViewEditForm extends ViewFormBase {
*/
public static function create(ContainerInterface $container) {
return new static(
- $container->get('user.shared_tempstore'),
+ $container->get('tempstore.shared'),
$container->get('request_stack'),
$container->get('date.formatter'),
$container->get('element_info')
diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php
index 2e7fabd..b2be658 100644
--- a/core/modules/views_ui/src/ViewUI.php
+++ b/core/modules/views_ui/src/ViewUI.php
@@ -48,7 +48,7 @@ class ViewUI implements ViewEntityInterface {
* If this view is locked for editing.
*
* If this view is locked it will contain the result of
- * \Drupal\user\SharedTempStore::getMetadata(). Which can be a stdClass or
+ * \Drupal\Core\TempStore\SharedTempStore::getMetadata(). Which can be a stdClass or
* NULL.
*
* @var stdClass
@@ -855,7 +855,7 @@ class ViewUI implements ViewEntityInterface {
}
/**
- * Sets a cached view object in the user tempstore.
+ * Sets a cached view object in the shared tempstore.
*/
public function cacheSet() {
if ($this->isLocked()) {
@@ -878,7 +878,7 @@ class ViewUI implements ViewEntityInterface {
$executable->default_display = NULL;
$executable->query = NULL;
$executable->displayHandlers = NULL;
- \Drupal::service('user.shared_tempstore')->get('views')->set($this->id(), $this);
+ \Drupal::service('tempstore.shared')->get('views')->set($this->id(), $this);
}
/**
diff --git a/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php b/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
index 51e489d..c8da87c 100644
--- a/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
@@ -3,7 +3,7 @@
namespace Drupal\Tests\views_ui\Functional;
/**
- * Tests the user tempstore cache in the UI.
+ * Tests the shared tempstore cache in the UI.
*
* @group views_ui
*/
@@ -17,12 +17,12 @@ class CachedDataUITest extends UITestBase {
public static $testViews = ['test_view'];
/**
- * Tests the user tempstore views data in the UI.
+ * Tests the shared tempstore views data in the UI.
*/
public function testCacheData() {
$views_admin_user_uid = $this->fullAdminUser->id();
- $temp_store = $this->container->get('user.shared_tempstore')->get('views');
+ $temp_store = $this->container->get('tempstore.shared')->get('views');
// The view should not be locked.
$this->assertEqual($temp_store->getMetadata('test_view'), NULL, 'The view is not locked.');
@@ -40,7 +40,7 @@ class CachedDataUITest extends UITestBase {
// Cancel the view edit and make sure the cache is deleted.
$this->drupalPostForm(NULL, [], t('Cancel'));
- $this->assertEqual($temp_store->getMetadata('test_view'), NULL, 'User tempstore data has been removed.');
+ $this->assertEqual($temp_store->getMetadata('test_view'), NULL, 'Shared tempstore data has been removed.');
// Test we are redirected to the view listing page.
$this->assertUrl('admin/structure/views', [], 'Redirected back to the view listing page.');
diff --git a/core/modules/views_ui/views_ui.services.yml b/core/modules/views_ui/views_ui.services.yml
index 27fa334..adf87e6 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', '@config.factory', '@router.admin_context']
+ arguments: ['@entity.manager', '@tempstore.shared', '@config.factory', '@router.admin_context']
tags:
- { name: paramconverter, priority: 10 }
lazy: true