Actions
Bug #95899
openTry to cache an extbase queryResult leads to "Serialization of 'Closure' is not allowed"
Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2021-11-07
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
I would like to add some caching into my backend views in lux to speed up diagrams.
But in TYPO3 11.5.2 together (with PHP 7.4 or 8.0) I always ran into the exception:
"Serialization of 'Closure' is not allowed"
An example extbase model could be very simple (without any relations or Lazy Loading) with just one string property and extend AbstractEntity. Also the repository function is without magic here:
$query = $this->createQuery(); $query->setLimit(3); $query->setOrderings(['uid' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING]); return $query->execute();
If I try to cache the result like
$cacheInstance = GeneralUtility::makeInstance(CacheManager::class)->getCache('bar'); $cacheInstance->set('foo', $queryResult, ['bar'], 100000);
The error is happening:
Any ideas?
Files
Actions