Skip to content

Commit

Permalink
fix folder deletion bug (AsgardCms#715)
Browse files Browse the repository at this point in the history
prevent deletion of folders that are NOT actually subfolders and only
start with the same sequence of characters. Originally, if I have two
or more folders on the same level:
`slider`
`slider-homepage`
and I delete only the `slider` one, `slider-homepage` would get deleted
as well.

This change makes sure the deleted folders are actually subfolders of
the deleted one.
  • Loading branch information
becquerel committed Jul 16, 2019
1 parent 6676b94 commit a729961
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function allChildrenOf(File $folder)
{
$path = $folder->path->getRelativeUrl();

return $this->model->where('path', 'like', "{$path}%")->get();
return $this->model->where('path', 'like', "{$path}/%")->get();
}

public function allNested(): NestedFoldersCollection
Expand Down

0 comments on commit a729961

Please sign in to comment.