Bug #57374

Persisted entities saved in session are not resolved

Added by Aimo Künkel over 7 years ago. Updated over 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Session
Start date:
2014-03-27
Due date:
% Done:

0%

Estimated time:
1.00 h
PHP Version:
Has patch:
No
Complexity:
easy

Description

If you save a persisted entity in the session via

$this->session->putData("myEntity", $myEntity);

it is saved like some normal entity.

So later on if you do

$sessionEntity = $this->session->getData("myEntity");
$persistedEntity = $this->entityRepository->findByIdentifier( $sessionEntity->getIdentifier() );
\TYPO3\Flow\var_dump($sessionEntity);
\TYPO3\Flow\var_dump($persistedEntity);
\TYPO3\Flow\var_dump($sessionEntity === $persistedEntity);
die();

it show you twice the same object, but it's not the same.

It should instead just save the id in the background and fetch it again from the repo in case of a persisted entity.
Otherwise it's impossible to work with, because you e.g. can't pass it to the repo for updating and so on.

I'll provide a patch if wished, just comment please.

No data to display

Also available in: Atom PDF