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

Media library: removing folder with sub folders #2567

Closed
Katrienvh opened this Issue Jun 8, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@Katrienvh
Contributor

Katrienvh commented Jun 8, 2018

Type

  • Enhancement

Problem description

You can remove a folder with sub folders. I should handle this like we handle the pages.
Do no give the user the possibility to remove a folder with subfolders?

Or maybe add an extra alert that also the subfolders will disappear.

@jeroendesloovere

This comment has been minimized.

Member

jeroendesloovere commented Jul 2, 2018

While testing what you said.
I discovered a bug.

"There should always be at least one folder".
But when I have

- default
    * subfolder 1
    * subfolder 2

=> If you delete default, all folders are gone. So we don't have any left... BUG...

Proposed solution

So I advice we use your first solution: "Do no give the user the possibility to remove a folder with subfolders"

What do @forkcms/core-contributors think about this?

@jeroendesloovere jeroendesloovere added this to the 5.4.0 milestone Jul 2, 2018

@carakas

This comment has been minimized.

Member

carakas commented Jul 2, 2018

that is a solution or you block the deletion of the default folder

@jeroendesloovere

This comment has been minimized.

Member

jeroendesloovere commented Jul 2, 2018

Well, there is no "hard-coded database field" $isDefault.

But we do have a abortIfLastFolder method, but it seems out this is not yet bullet-proof (see bug above).
=> Solution: make this bullet proof.

@jeroendesloovere

This comment has been minimized.

Member

jeroendesloovere commented Jul 2, 2018

Info: there is another method checkIfDeleteIsAllowed which checks if the folder has subfolders (and connected items in it).

If we want to "hide the delete folder button", we should move these checks to twig.

@carakas

This comment has been minimized.

Member

carakas commented Jul 2, 2018

if it is too complicated I would just block deleting if there are subfolders

@carakas

This comment has been minimized.

Member

carakas commented Jul 2, 2018

or update the check if delete is allowed only looks at parent folders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment