After saving a form that contains a relationship the relationship section is empty. The data is correctly stored and fetched but filament clear the data.ralationship node by filling all the components states with null values.
I've tried to trace the issue out and I've seen that:
EditRecord.php
EditRecord.php
call the
$this->form->getState()
$this->form->getState()
.
this method is the responsible of the data object to be overwritten. More specifically is the
loadStateFromRelationship()
loadStateFromRelationship()
that when run the data is not somehow re-fetched and null is loaded instead.
$this->fillStateWithNull()
$this->fillStateWithNull()
is called inside the component.
Why the data is not loaded correctly after the save?