Bug #25902
It's not possible to add an entity as link/redirect argument
Added by Bastian Waidelich almost 10 years ago.
Updated almost 10 years ago.
Description
It's very common to redirect to a details view after creating an entity:
public function createAction(Foo $foo) {
$this->fooRepository->add($foo);
$this->redirect('show', NULL, NULL, array('foo' => $foo))
}
But that won't work because the entity is not (yet) known to the Persistence Manager, which is asked for the identity of the object in the Route in order to convert Objects to Identity arrays:
...
if (is_object($routeValue)) {
$uuid = $this->persistenceManager->getIdentifierByObject($routeValue);
...
- Priority changed from Should have to Must have
Additional notes:
Calling
$this->persistenceManager->persistAll();
before redirecting solves the issue temporarily but I have the same issue for updates, where this work around has no effect, so this is a real blocker currently:
public function updateAction(Foo $foo) {
$this->fooRepository->update($foo);
$this->redirect('show', NULL, NULL, array('foo' => $foo))
}
- Status changed from New to Accepted
- Target version set to 1.0 beta 1
- % Done changed from 0 to 40
Partly solved, as new entities now have an identifier for their whole lifetime (generated through AOP).
Leaves the update case open...
Patch set 1 of change I8a5547ab34732c4c6db5369da14337cb3b7a3047 has been pushed to the review server.
It is available at http://review.typo3.org/1773
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 40 to 100
Also available in: Atom
PDF