Skip to content
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

User can drag/drop files onto a non-mounted folder #7174

Open
aschempp opened this issue May 1, 2024 · 2 comments
Open

User can drag/drop files onto a non-mounted folder #7174

aschempp opened this issue May 1, 2024 · 2 comments
Labels
Milestone

Comments

@aschempp
Copy link
Member

aschempp commented May 1, 2024

Affected version(s)

5.3

Description

Since Contao 5.3 (I think) the parent folders of mounted folder are visible in the file tree. When drag & dropping a file throught the drag handle, the user can also drop it on a non-mounted (parent) folder. Access permissions are checked correctly, so this will result in an exception. I think it would be best to use a class or data attribute to mark folders that should be droppable and the ones that should not be.

@aschempp aschempp added this to the 5.3 milestone May 1, 2024
@leofeyer
Copy link
Member

leofeyer commented May 2, 2024

@ausi Am I right in assuming that we have to add a CSS class to these parent folders and adjust the droppables elements accordingly?

droppables: $$([ul]).append(ul.getElements('.tl_folder,li.parent,.tl_folder_top')),

@ausi
Copy link
Member

ausi commented May 2, 2024

Probably needs to be adjusted here as well I think:

move.droppables = $$([ul]).append(ul.getElements('.tl_folder,li.parent'));

return droppable.getPrevious('.tl_folder');

var folder = target.match('.tl_folder') ? target : target.getParent('.tl_folder');
if (!folder) {
folder = target.getParent('.parent');
folder = folder && folder.getPrevious('.tl_folder');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants