[TYPO3-mvc] Cannot update a 1:n relation [BUG FOUND]

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Aug 16 12:20:23 CEST 2010


Hey again,

>> Test goes into if ($currentValue instanceof
>> Tx_Extbase_Persistence_ObjectMonitoringInterface) but:
>>
>> - previousValue is an object => isDirty = FALSE
>> - $currentValue is not dirty as the referenced object itself was not
>> modified => isDirty = FALSE
>> - both previous and current value have the same class!
>>
>> As test, I deactivated this test to use the "For all other objects we do
>> only a simple comparison
>>
>> After that, my relation is properly updated. Can someone from Extbase
>> team understands where the "real" error is?
>
> That should be in fact the "real" cause of this error, but I'm not sure
> if a object comparison is the best solution here, because it had a
> reason why the Tx_Extbase_Persistence_ObjectMonitoringInterface has been
> introduced and the _isDirty method had been changed recently.
> Doing the comparison as last step if everything else fails should be
> save I think, but I'll better double check that for possible side effects.

we can't use the object comparison here, because it will lead to false 
positives if the compared objects contain lazyLoaded properties (so if 
it's the same object, but the lazyLoadingProxy replaced itself with the 
real instance in $currentValue). So probably better check if the object 
has a UID and if so, compare those? But I have to think about any other 
side effects with this again :)

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list