TYPO3 Exception 1249479819


You need to make sure that your object is already persisted before calling Repository->update($o); Add it first with Repository->add($o);

Usage of (new) property mapper / t3extblog

I encountered this exception when trying to install/use t3extblog with TYPO3 6.2.10. Check your code for correct usage of (new) property mapper, this should give you a hint (taken from https://forge.typo3.org/issues/51330):

old property mapper is not supported anymore and removed from the Core after 6.2. Use the new one instead.

For those who do not know how to fix it, I will show how I have fixed it.

Old code:

$persistenceManager =

New code:

$objectManager =
$persistenceManager =

Object retrieved by property mapper can't get updated via persistence manager

If you try to ->update() an object which has been retrieved from the property mapper by mapping GET/POST parameters, so if you pass the object as argument of your controller action, this issue may occur.

For me the solution was to re-retrieve the object using the repository and ->findByUid() method and then persist/update the retrieved object. It seems the repository needs to "know" about the object.

function yourAction(\Some\Model $item)
    $updateItem = $this->itemRepository->findByUid($item->getUid());
     *  something with $updateItem ...