[TYPO3-mvc] Problems with updating / mapping, related issue #9270
Franz Koch
typo3.RemoveForMessage at elements-net.de
Mon Jan 31 18:14:51 CET 2011
Hey,
...
> So there is a circular dependency between album(item) --> item and
> item(album) --> album.
>
> When I edit an album and update it later on, I get a memory-error
> (allowed memory-size exhausted...).
Watch out on circular references. Best is to use the "@lazy" annotation
at least for one of the sides of the relation. According to your model
I'd set the album property of the item to @lazy.
> And if I do something like this:
>
> public function updateAction(Tx_Yag_Domain_Model_Album $album) {
> $this->albumRepository->update($album);
> $this->flashMessages->add('Album has been updated!');
> $this->forward('edit', null, null, array('album' => $album));
> }
>
> I get an error: The value must be of type "Tx_Yag_Domain_Model_Album",
> but was of type "NULL".
Just out of curiosity - does the following work:
$this->forward('edit', null, null, array('album' => $album->getUid()));
If not, just try $this->forward('edit') as the incoming get/postVars
should automatically be passed to the new action (unlike on redirects).
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list