You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a grid field is editing a many-many-through relation, the "join object" will be available on each record via DataObject::getJoin()..
Although it's currently a bit awkward and requires boilerplate such as this in your DataObject, you can then open these records up for editing in your edit form:
I'd like to set the flag. We could either set it in all cases (which would let people modify any has_one relationship on a grid field edit form), or just for objects that have a join record (which would limit the bugfix to the place I tripped over it, possibly prevent current code that relies on this bug from being broken, but risking that we need to change this code a second time.
The text was updated successfully, but these errors were encountered:
My instinct is to set writeComponent = true in all cases, as it's safe and will make the framework more flexible, especially if #9163 is also implemented.
I'm going to need to re-introduce this as a config option rather than a change to the default, assuming #9519 is merged into 4.5, which seems to be the consensus.
When a grid field is editing a many-many-through relation, the "join object" will be available on each record via DataObject::getJoin()..
Although it's currently a bit awkward and requires boilerplate such as this in your DataObject, you can then open these records up for editing in your edit form:
The problem is that
write()
by default doesn't write components. Triggering this requires one of the flags passed to write being set here: https://github.com/silverstripe/silverstripe-framework/blob/4/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php#L615I'd like to set the flag. We could either set it in all cases (which would let people modify any has_one relationship on a grid field edit form), or just for objects that have a join record (which would limit the bugfix to the place I tripped over it, possibly prevent current code that relies on this bug from being broken, but risking that we need to change this code a second time.
The text was updated successfully, but these errors were encountered: