It isn't possible to use a newly created local ResourceStorage
If you create a new ResourceStorage through the StorageRepository->createLocalStorage method and there is already other ResourceStorages registered, it isn't possible to get the ResourceStorage object from either the StorageRepository->FindByUid or ResourceFactory->getStorageObject method.
This is due to caches not being updated after the new ResourceStorage record have inserted into the database.
I guess the best solution would be to have a signal to indicate when the storage cache should be updated, probably both in StorageRepository and ResourceFactory.
[BUGFIX] Update local cache upon creation of new storage object
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.
Reviewed-by: Benni Mack <firstname.lastname@example.org>
Tested-by: Benni Mack <email@example.com>
Tested-by: TYPO3com <firstname.lastname@example.org>
Reviewed-by: Wouter Wolters <email@example.com>
Tested-by: Wouter Wolters <firstname.lastname@example.org>