Bug #34879

Proxied object is not update()able

Added by Adrian Föder almost 9 years ago. Updated about 8 years ago.

Status:
Accepted
Priority:
Must have
Category:
Persistence
Target version:
-
Start date:
2012-03-15
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

in my use case, I have objects as children of a parent object.
I access these children via the <for each=""> ViewHelper, and do further processing with each accrued object.
Such an accrued object is, in my case, a proxy representation of the actual object; during the further processing I modify that object (especially calling ->add() on it).

Still being the Proxy, I call persistenceManager->update() with it, but that gives the Exception

The object of type "TYPO3\FLOW3\Persistence\Doctrine\Proxies\AcmeDemoDomainModelProductProxy" given to update must be persisted already, but is new.

also persistenceManager->isNewObject() claims it was a new object, but it definitely isn't.

#1

Updated by Karsten Dambekalns over 8 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Karsten Dambekalns

Can you check if that problem still exists and maybe produce a testcase to reproduce it?

#2

Updated by Karsten Dambekalns over 8 years ago

Ping…

#3

Updated by Adrian Föder over 8 years ago

  • Assignee changed from Karsten Dambekalns to Adrian Föder

ouf, sorry; I currently don't even remember where it was and ATM have not really time to concentrate on this. Will place it on hold, ok? I'm sure it exists and it'll catch me again, but I have to see when that happens.

#4

Updated by Karsten Dambekalns over 8 years ago

  • Status changed from Needs Feedback to On Hold

Ok, thanks!

#5

Updated by Adrian Föder about 8 years ago

I managed to experience the error again; not in the exact same situation like initially described, but maybe comparable. See the following package here:

https://github.com/afoeder/Bugdemo.UpdateProxyObject

An object is stored inside the widgetConfiguration but apparently something doesn't manage to reanimate it across the methods.

#6

Updated by Karsten Dambekalns about 8 years ago

  • Status changed from On Hold to Accepted
  • Assignee changed from Adrian Föder to Karsten Dambekalns
#7

Updated by Adrian Föder about 8 years ago

I recently had an idea why this could be; see also the note at https://github.com/afoeder/Bugdemo.UpdateProxyObject/issues/1:

I had the idea that it's maybe not unlikely that the entity is just "simply" serialized for the WidgetContext, and after deserializing it maybe does not become hydrated sufficiently. Because, if I, for example, do the following:

$intendedObject = $this->widgetConfiguration['intendedObject'];
$intendedObjectClassName = get_class($intendedObject);
$identifier = $this->persistenceManager->getIdentifierByObject($intendedObject);
$reHydratedObject = $this->persistenceManager->getObjectByIdentifier($identifier, $intendedObjectClassName);


	

this "recycled" object now works as expected.

Also available in: Atom PDF