Skip to content

Commit

Permalink
fix #914
Browse files Browse the repository at this point in the history
  • Loading branch information
jqhph committed Jan 3, 2021
1 parent 3755d05 commit c92275f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 7 additions & 1 deletion src/Form/Concerns/HasFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c92275f

Please sign in to comment.