diff --git a/src/Form.php b/src/Form.php index c933e39f7..5f6727124 100755 --- a/src/Form.php +++ b/src/Form.php @@ -284,7 +284,7 @@ public function __construct($repository = null, ?Closure $callback = null, Reque { $this->repository = $repository ? Admin::repository($repository) : null; $this->callback = $callback; - $this->request = clone ($request ?: request()); + $this->request = $request ?: request(); $this->builder = new Builder($this); $this->isSoftDeletes = $repository ? $this->repository->isSoftDeletes() : false; diff --git a/src/Form/Concerns/HasFiles.php b/src/Form/Concerns/HasFiles.php index 75cf300ec..fbef06732 100644 --- a/src/Form/Concerns/HasFiles.php +++ b/src/Form/Concerns/HasFiles.php @@ -207,7 +207,13 @@ protected function handleFileDelete(array $input = []) } } - $input = Arr::only($input, [Field::FILE_DELETE_FLAG, $input['_column']]); + $fields = [Field::FILE_DELETE_FLAG, $input['_column']]; + + if (isset($relation)) { + $fields[] = $relation; + } + + $input = Arr::only($input, $fields); $this->request->replace($input);