Production:
image_id
Image:
id
ImageForm is built into ProductionForm, and an image is optional. The problem is that when you add an image to an existing Production through an embedded form and without changing any standard values ββin the Production form, the main form is not saved (Production has no changes), except that it image_idneeds to be updated .
Iβm in two minds, the problem is that I did not configure these forms correctly or I need to add something to the binding of the save method.
Please note that this problem does not occur if the production is new, i.e. you add a new production and the image right away - or if you edit the production (i.e. change its name to another field) and add the image. Or if you are editing an image that is already connected.
I understand why this is happening, and the order of Symfony is saving to forms. But I donβt know what to add to make this work.
So far there is not much code, only what is on the extended forms of jobeet; I use $this->embedRelation('Image');, and post validator + saveEmbeddedForms overrides to avoid saving blank images.
: , - , , , , _id, .