Skip to content

Fix two tab deletion issues#6446

Merged
donker merged 4 commits intodnnsoftware:developfrom
bdukes:tab-deletion
Mar 25, 2025
Merged

Fix two tab deletion issues#6446
donker merged 4 commits intodnnsoftware:developfrom
bdukes:tab-deletion

Conversation

@bdukes
Copy link
Copy Markdown
Contributor

@bdukes bdukes commented Mar 12, 2025

Summary

This PR fixes two bugs with deleting tabs. The first is described in #6438. The second comes when calling DeleteTab on a tab that has already been deleted (perhaps related to a workaround for the first issue 😉).

Fixes #6438

@bdukes bdukes added this to the 9.14.0 milestone Mar 12, 2025
Copy link
Copy Markdown
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

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

Is HardDeleteTabInternal ok here in the context ? Does that skip the recycle bin ?

@bdukes
Copy link
Copy Markdown
Contributor Author

bdukes commented Mar 13, 2025

Is HardDeleteTabInternal ok here in the context ? Does that skip the recycle bin ?

Yes, this is all hard deleting. The DeleteTab call that this replaced looks like this:

/// <summary>Deletes a tab permanently from the database.</summary>
/// <param name="tabId">TabId of the tab to be deleted.</param>
/// <param name="portalId">PortalId of the portal.</param>
/// <remarks>
/// The tab will not delete if it has child tab(s).
/// </remarks>
public void DeleteTab(int tabId, int portalId)
{
// parent tabs can not be deleted
if (this.GetTabsByPortal(portalId).WithParentId(tabId).Count == 0)
{
this.HardDeleteTabInternal(tabId, portalId);
}
this.ClearCache(portalId);
}

So this is just removing the check for children tabs, since it just took care of them.

@bdukes bdukes requested a review from mitchelsellers March 24, 2025 17:38
Copy link
Copy Markdown
Contributor

@donker donker left a comment

Choose a reason for hiding this comment

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

LGTM

@donker donker merged commit 6a3512e into dnnsoftware:develop Mar 25, 2025
3 checks passed
@bdukes bdukes deleted the tab-deletion branch March 31, 2025 20:20
@valadas valadas modified the milestones: 9.14.0, 9.13.9 Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TabController.DeleteTab with deleteDescendants fails to delete the passed tab

3 participants