Extbase objects retrieved from a fe_user session cannot be persisted in their Repository
How to reproduce:
- Save an extbase model object in the fe_user session:
$GLOBALS['TSFE']->fe_user->setKey('ses', 'sessionname', $foo);
- Now retrieve the object from the session:
$foo = $GLOBALS['TSFE']->fe_user->getKey('ses', 'sessionname');
- A complete extbase model object will now be retrieved. However if you use the "update" method of the Repository, the call will fail with the exception:
The object of type "Foo" given to update must be persisted already, but is new.
If you call _isNew() on the object from the session, it will return false.
#1 Updated by Gerrit Code Review 5 months ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62782