diff --git a/core/lib/Drupal/Core/TempStore/SessionTempStore.php b/core/lib/Drupal/Core/TempStore/SessionTempStore.php index 83475c2..5cd9336 100644 --- a/core/lib/Drupal/Core/TempStore/SessionTempStore.php +++ b/core/lib/Drupal/Core/TempStore/SessionTempStore.php @@ -36,10 +36,18 @@ class SessionTempStore extends TempStoreBase { } /** + * Overrides TempStoreBase::testStoredObjects(). + */ + public static function testStoredObjects($subsystem, $keys) { + return db_query("SELECT t.temp_key, s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.ownerId = s.ownerId WHERE t.subsystem = :subsystem AND t.temp_key IN (:keys) ORDER BY t.updated ASC", array(':subsystem' => $subsystem, ':temp_keys' => $keys)) + ->fetchAllAssoc('temp_key'); + } + + /** * Overrides TempStoreBase::getLockOwner(). */ public function getLockOwner($key, $exclude_owner = FALSE) { - $lock_owner = db_query('SELECT s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.ownerId = s.ownerId WHERE t.subsystem = :subsystem AND t.temp_key = :temp_key ORDER BY t.updated ASC', array( + $lock_owner = db_query('SELECT s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.ownerId = s.sid WHERE t.subsystem = :subsystem AND t.temp_key = :temp_key ORDER BY t.updated ASC', array( ':subsystem' => $this->subsystem, ':temp_key' => $key, ))->fetchObject(); diff --git a/core/lib/Drupal/Core/TempStore/SpecialTempStore.php b/core/lib/Drupal/Core/TempStore/SpecialTempStore.php index b0fb8ac..b4e501d 100644 --- a/core/lib/Drupal/Core/TempStore/SpecialTempStore.php +++ b/core/lib/Drupal/Core/TempStore/SpecialTempStore.php @@ -35,4 +35,12 @@ class SpecialTempStore extends TempStoreBase { ))->fetchField(); } + /** + * Overrides TempStoreBase::testStoredObjects(). + */ + public static function testStoredObjects($subsystem, $keys) { + return db_query("SELECT t.temp_key, t.updated FROM {temp_store} t WHERE t.subsystem = :subsystem AND t.temp_key IN (:keys) ORDER BY t.updated ASC", array(':subsystem' => $subsystem, ':temp_keys' => $keys)) + ->fetchAllAssoc('temp_key'); + } + } diff --git a/core/lib/Drupal/Core/TempStore/TempStoreBase.php b/core/lib/Drupal/Core/TempStore/TempStoreBase.php index ccb848b..ff9a0d6 100644 --- a/core/lib/Drupal/Core/TempStore/TempStoreBase.php +++ b/core/lib/Drupal/Core/TempStore/TempStoreBase.php @@ -67,9 +67,9 @@ abstract class TempStoreBase { // @todo We may wish to add static caching here in the future, either // as a static cache on the object or using drupal_static(). $data = db_query( - 'SELECT * FROM {temp_store} WHERE ownerId = :session_id AND subsystem = :subsystem AND temp_key = :temp_key', + 'SELECT * FROM {temp_store} WHERE ownerId = :ownerID AND subsystem = :subsystem AND temp_key = :temp_key', array( - ':session_id' => $this->ownerId, + ':ownerID' => $this->ownerId, ':subsystem' => $this->subsystem, ':temp_key' => $key, ) @@ -112,7 +112,7 @@ abstract class TempStoreBase { } /** - * Removes one or more objects from this store for this session. + * Removes one or more objects from this store for this temp store. * * @param string|array $key * The key to the stored object, or an array of keys. See @@ -123,7 +123,7 @@ abstract class TempStoreBase { } /** - * Removes one or more objects from this store for all sessions. + * Removes one or more objects from this store for all temp store. * * @param string|array $key * The key to the stored object, or an array of keys. See @@ -187,8 +187,7 @@ abstract class TempStoreBase { * TempStoreBase::set() for details. */ public static function testStoredObjects($subsystem, $keys) { - return db_query("SELECT t.temp_key, s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.ownerId = s.ownerId WHERE t.subsystem = :subsystem AND t.temp_key IN (:keys) ORDER BY t.updated ASC", array(':subsystem' => $subsystem, ':temp_keys' => $keys)) - ->fetchAllAssoc('temp_key'); + return; } /**