Skip to content

Commit 6a3512e

Browse files
bdukesvaladas
andauthored
Fix two tab deletion issues (dnnsoftware#6446)
* Fix recursive delete failing Fixes dnnsoftware#6438 * Fix null reference when deleting tab that's already deleted --------- Co-authored-by: Daniel Valadas <info@danielvaladas.com>
1 parent a2f1dfd commit 6a3512e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

DNN Platform/Library/Entities/Tabs/TabController.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,8 @@ public void DeleteTab(int tabId, int portalId, bool deleteDescendants)
12211221
}
12221222
}
12231223

1224-
this.DeleteTab(tabId, portalId);
1224+
this.HardDeleteTabInternal(tabId, portalId);
1225+
this.ClearCache(portalId);
12251226
}
12261227

12271228
/// <summary>Delete a Setting of a tab instance.</summary>
@@ -2902,7 +2903,10 @@ private void HardDeleteTabInternal(int tabId, int portalId)
29022903
contentController.DeleteContentItem(tab);
29032904
}
29042905

2905-
EventManager.Instance.OnTabDeleted(new TabEventArgs { Tab = tab });
2906+
if (tab != null)
2907+
{
2908+
EventManager.Instance.OnTabDeleted(new TabEventArgs { Tab = tab });
2909+
}
29062910
}
29072911

29082912
private bool SoftDeleteChildTabs(int intTabid, PortalSettings portalSettings)

0 commit comments

Comments
 (0)