[TYPO3-mvc] All childs empty - isModified false. Workaround Question

Franz Koch typo3.RemoveForMessage at elements-net.de
Sun Nov 28 01:20:34 CET 2010


Hey there,

> This works fine by itself as long as at least one child remains in the
> corresponding field in the request (so in the End in the object
> storage). For example if I had 3 Medications filled in (as above) and I
> delete Medication 3, it is disconnected as we expect. Medication 1 and 2
> remain in the request and are persisted again.
> If we remove all three childs though, the childs are not disconnected.
> It seems that in the child Object Storage "isModified" is not set.

Have you checked the content of the objectStorage property in the 
incoming object? Is it really empty or is it reconstituted from the 
original object?
AFAIK if you don't submit a property in the request it's not processed, 
so if you remove the property from the request object by deleting them 
from the post array, I assume extbase is not treating this property at 
all. I didn't have a look at the code though.

If the property is still part of the request, but your storage is not 
emptied, it's a bug.

I could also assume that it's really a but and just a case of probably a 
missing hidden field in the form storing the initial count or something. 
Just like it's done for checkboxes or with the __identity fields. Some 
field that's indicating the property was there, even if no child objects 
where submitted, something like:

<input type="hidden" 
name="tx_exkey_whatever[object][objectStorageProperty][__count]" 
value="count of initial storage" />

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list