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

Fix deleting sub objects of locked folders if folder is selected #848

Merged
merged 7 commits into from
Mar 10, 2025

Conversation

mattamon
Copy link
Contributor

@mattamon mattamon commented Mar 3, 2025

Resolves #847

@mattamon mattamon added the Bug label Mar 3, 2025
@mattamon mattamon added this to the 1.7.5 milestone Mar 3, 2025
@mattamon mattamon changed the title 847 fix deleting sub objects of locked folders Fix deleting sub objects of locked folders if folder is selected Mar 3, 2025
@mattamon mattamon requested a review from Copilot March 3, 2025 12:44
Copilot

This comment was marked as outdated.

@mattamon mattamon requested a review from Copilot March 3, 2025 12:46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR fixes an issue whereby sub objects of locked folders are incorrectly deleted when the folder itself is selected. Key changes include the filtering of deleted items to remove those that are not allowed and updating the logic that determines if any deletable items remain.

Reviewed Changes

File Description
public/js/pimcore/elementservice.js Added filtering to remove items not allowed to be deleted; redundant filtering remains when checking for deletable items.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

public/js/pimcore/elementservice.js:56

  • Since res.itemResults has already been filtered to include only allowed items on line 54, consider replacing this redundant filter with a direct length check, e.g., hasDeleteable = res.itemResults.length > 0.
hasDeleteable = res.itemResults.filter(function (result) {
@mattamon mattamon requested a review from Copilot March 3, 2025 12:49
Copilot

This comment was marked as outdated.

Copy link

sonarqubecloud bot commented Mar 3, 2025

@mattamon mattamon requested a review from martineiber March 3, 2025 14:43
@robertSt7 robertSt7 merged commit 9e32012 into 1.7 Mar 10, 2025
8 checks passed
@robertSt7 robertSt7 deleted the 847-fix-deleting-sub-objects-of-locked-folders branch March 10, 2025 17:00
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Items under locked folder are deleted when trying to delete locked folder
3 participants