Skip to content

Commit

Permalink
FIX Remove write from SearchableDropdownTrait
Browse files Browse the repository at this point in the history
In the SearchableDropdownTrait::saveInto method, if the field is a has_one relationship, $record->write() was called. FormField and any other instances of saveInto should not call write - that should be called by the form itself.
  • Loading branch information
johannes.hammersen authored and johannes.hammersen committed Jun 19, 2024
1 parent 2787393 commit ce5cfca
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Forms/SearchableDropdownTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ public function saveInto(DataObjectInterface $record): void
$record->$classNameField = $ids ? $record->ClassName : '';
}
}
$record->write();
} else {
// has_many / many_many field
if (!method_exists($record, 'hasMethod')) {
Expand Down

0 comments on commit ce5cfca

Please sign in to comment.