Problem/Motivation

Every backend_overridable service is extra complexity. TempStoreFactory hardwires the database storage and that's completely unnecessary.

Proposed resolution

Just inject the K-V expirable factory.

Beta phase evaluation

-->

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug
Prioritized changes Bugfix and decreases fragility by applying good design patterns.
CommentFileSizeAuthor
#2 2405737_2.patch4.96 KBchx
user_temp.patch4.53 KBchx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Needs review » Needs work
+++ b/core/modules/user/src/TempStoreFactory.php
@@ -57,9 +56,9 @@ class TempStoreFactory {
     $this->serializer = $serializer;

@@ -86,7 +85,7 @@ function get($collection, $owner = NULL) {
-    $storage = new DatabaseStorageExpirable($collection, $this->serializer, $this->connection);
+    $storage = $this->storageFactory->get("user.tempstore.$collection");

We don't nee the serializer anymore as well.

chx’s picture

FileSize
4.96 KB

You are right, of course.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

+1

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1b2e7c4 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed 1b2e7c4 on 8.0.x
    Issue #2405737 by chx: user.tempstore is unnecessary to be...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.