-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] deleting folder causes other folders that start the same to be deleted too #715
Comments
becquerel
added a commit
to becquerel/Platform
that referenced
this issue
Jul 16, 2019
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary of issue
When deleting the folder, other folders on the same level (not inside) get deleted as well
Steps to reproduce
create two directories:
slider
andslider-homepage
. Delete only theslider
directory -slider-homepage
will get deleted as wellSystem Details
v3.6.1
Problem is in
Modules/Media/Repositories/Eloquent/EloquentFolderRepository.php
, line 85return $this->model->where('path', 'like', "{$path}%")->get();
it tries to find all folders that start with the same string as the deleted folder. Perhaps missing forward slash would do the trick ? (seems it does for me)
return $this->model->where('path', 'like', "{$path}/%")->get();
The text was updated successfully, but these errors were encountered: