[BUGFIX] Add initialization of DataMapper on QueryResult object wakeup 20/61820/3
authorVladimir Cherednichenko <noreply@example.com>
Thu, 30 May 2019 10:01:22 +0000 (12:01 +0200)
committerAlexander Schnitzler <review.typo3.org@alexanderschnitzler.de>
Mon, 21 Oct 2019 17:16:42 +0000 (19:16 +0200)
`DataMapper` object initialization is missed in this place.
And it leads to error `Call to a member function map() on null` when
`QueryResult` object retrieved from cache.

Releases: master, 9.5
Resolves: #88463
Change-Id: I8e250986ea899e033349c9b0d10c55c7381a7ff5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61820
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Felix P. <f.pachowsky@neusta.de>
Reviewed-by: Sascha Rademacher <sascha.rademacher+typo3@gmail.com>
Reviewed-by: Julian Geils <j_geils@web.de>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php

index 2303568..ab933ad 100644 (file)
@@ -265,6 +265,7 @@ class QueryResult implements QueryResultInterface
     {
         $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
         $this->persistenceManager = $objectManager->get(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
+        $this->dataMapper = $objectManager->get(DataMapper::class);
     }
 
     /**