Closed freshleafmedia closed 10 months ago
When the schema changes between different item types the data of the previous item type is still persisted.
Give the following item types:
FilamentNavigation::addItemType('TypeA', [ Select::make('url'), TextInput::make('label'), ]); FilamentNavigation::addItemType('Type B', [ Select::make('url'), ]);
Type A
Type B
You will see the saved JSON contains a label property even though Type B doesn't have this field.
label
I believe the offending code is this block: https://github.com/ryangjchandler/filament-navigation/blob/7221e37aae3f3afc953923ac7fb052a90533726d/src/Filament/Resources/NavigationResource/Pages/Concerns/HandlesNavigationBuilder.php#L104-L108
I think it fills the previous state into the new form even though there are aren't fields to contain some of the state.
Please try to reproduce in Filament v3 with the latest version of this plugin.
When the schema changes between different item types the data of the previous item type is still persisted.
Give the following item types:
Type A
Type B
You will see the saved JSON contains a
label
property even thoughType B
doesn't have this field.I believe the offending code is this block: https://github.com/ryangjchandler/filament-navigation/blob/7221e37aae3f3afc953923ac7fb052a90533726d/src/Filament/Resources/NavigationResource/Pages/Concerns/HandlesNavigationBuilder.php#L104-L108
I think it fills the previous state into the new form even though there are aren't fields to contain some of the state.