[BUGFIX] Update local cache upon creation of new storage object 58/56058/5
authorBernhard Kraft <kraftb@think-open.at>
Thu, 8 Mar 2018 12:39:36 +0000 (13:39 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 28 Oct 2018 16:54:52 +0000 (17:54 +0100)
When a new storage object for the "local" driver is being created
it is not possible to retrieve the new object instantaneous. The
objects are being cached in a local static variable which needs
to get flushed (set to "null") first.

Resolves: #86689
Resolves: #62273
Releases: master
Change-Id: Ib5a0d6b148ef7b503c26ccd1610519707a8fa86d
Reviewed-on: https://review.typo3.org/56058
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Resource/StorageRepository.php

index 97fc2bb..8148b05 100644 (file)
@@ -230,6 +230,9 @@ class StorageRepository extends AbstractRepository implements LoggerAwareInterfa
             ->getConnectionForTable($this->table);
         $dbConnection->insert($this->table, $field_values);
 
+        // Flush local resourceStorage cache so the storage can be accessed during the same request right away
+        $this->storageRowCache = null;
+
         return (int)$dbConnection->lastInsertId($this->table);
     }