diff --git a/core/lib/Drupal/Core/TempStore/TempStore.php b/core/lib/Drupal/Core/TempStore/TempStore.php index 0421a19..e425485 100644 --- a/core/lib/Drupal/Core/TempStore/TempStore.php +++ b/core/lib/Drupal/Core/TempStore/TempStore.php @@ -113,29 +113,6 @@ public function deleteMultiple(array $keys, $all = FALSE) { } /** - * Implements Drupal\Core\TempStore\TempStoreInterface::getLockOwner(). - */ - public function getLockOwner($key) { - return db_query( - 'SELECT owner_id AS ownerID, updated FROM {temp_store} WHERE namespace = :namespace AND temp_key = :temp_key ORDER BY updated ASC', - array( - ':namespace' => $this->namespace, - ':temp_key' => $key, - ) - )->fetchObject(); - } - - /** - * Implements Drupal\Core\TempStore\TempStoreInterface::isLocked(). - */ - public function isLocked($key) { - $lock_owner = $this->getLockOwner($key); - if ((isset($lock_owner->ownerID) && $this->ownerID != $lock_owner->ownerID)) { - return $lock_owner; - } - } - - /** * Implements Drupal\Core\TempStore\TempStoreInterface::testStoredObjects(). */ public static function testStoredObjects($namespace, array $keys) { diff --git a/core/lib/Drupal/Core/TempStore/TempStoreInterface.php b/core/lib/Drupal/Core/TempStore/TempStoreInterface.php index 53f9925..eafd639 100644 --- a/core/lib/Drupal/Core/TempStore/TempStoreInterface.php +++ b/core/lib/Drupal/Core/TempStore/TempStoreInterface.php @@ -75,32 +75,6 @@ public function deleteAll($key); public function deleteMultiple(array $keys, $all = FALSE); /** - * Determines if the object is in use by another store for locking purposes. - * - * @param string $key - * The key to the stored object. See TempStoreInterface::set() for details. - * @param bool $exclude_owner - * (optional) Whether or not to disregard the current user when determining - * the lock owner. Defaults to FALSE. - * - * @return stdClass|null - * An object with the user ID and updated date if found, otherwise NULL. - */ - public function getLockOwner($key); - - /** - * Checks to see if another owner has locked the object. - * - * @param string $key - * The key to the stored object. See TempStoreInterface::set() for details. - * - * @return stdClass|null - * An object with the owner ID and updated date, or NULL if there is no - * lock on the object belonging to a different owner. - */ - public function isLocked($key); - - /** * Fetches the last updated time for multiple objects in a given namespace. * * @param string $namespace diff --git a/core/modules/system/lib/Drupal/system/Tests/TempStore/TempStoreTest.php b/core/modules/system/lib/Drupal/system/Tests/TempStore/TempStoreTest.php index fe44614..ba767d4 100644 --- a/core/modules/system/lib/Drupal/system/Tests/TempStore/TempStoreTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/TempStore/TempStoreTest.php @@ -158,42 +158,6 @@ public function testUserTempStore() { $temp_store->get($new_key), 'An entry less than 7 days old is not cleaned.' ); - - // Test the getLockOwner() method. - $temp_store_one = new UserTempStore($namespace, $this->loggedInUser->uid); - - // Allow two users to be logged in at once. - $this->curlClose(); - $this->loggedInUser = FALSE; - - $this->drupalLogin($this->secondUser); - - // Add another stored object to the original user's data store. - $key_first_user = $this->randomName(); - $temp_store_one->set($key_first_user, $this->randomObject()); - - // Add a data store for the second user and store an object to it. - $temp_store_two = new UserTempStore($namespace, $this->loggedInUser->uid); - $key_second_user = $this->randomName(); - $temp_store_two->set($key_second_user, $this->randomObject()); - - // Confirm that the data is correctly saved for both users. - $this->assertEqual( - $temp_store_one->getLockOwner($key_first_user)->ownerID, - $this->firstUser->uid, - format_string( - 'Object %key is locked by user %user', - array('%key' => $key_first_user, '%user' => $this->firstUser->uid) - ) - ); - $this->assertEqual( - $temp_store_two->getLockOwner($key_second_user)->ownerID, - $this->secondUser->uid, - format_string( - 'Object %key is locked by user %user', - array('%key' => $key_first_user, '%user' => $this->firstUser->uid) - ) - ); } } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index cce2558..5bf075a 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2017,7 +2017,7 @@ function system_update_8021() { /** * Create the 'temp_store' table. */ -function system_update_8018() { +function system_update_8022() { $table = array( 'description' => t('A temporary data store for objects that are being edited. Allows state to be saved in a stateless environment.'), 'fields' => array(