Merge pull request #5558 from FransdeJong/DeleteDictionaryChildren
Added a check for and delete descendants when deleting a dictionary item
This commit is contained in:
@@ -52,6 +52,13 @@ namespace Umbraco.Web.Editors
|
||||
if (foundDictionary == null)
|
||||
throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
|
||||
var foundDictionaryDescendants = Services.LocalizationService.GetDictionaryItemDescendants(foundDictionary.Key);
|
||||
|
||||
foreach (var dictionaryItem in foundDictionaryDescendants)
|
||||
{
|
||||
Services.LocalizationService.Delete(dictionaryItem, Security.CurrentUser.Id);
|
||||
}
|
||||
|
||||
Services.LocalizationService.Delete(foundDictionary, Security.CurrentUser.Id);
|
||||
|
||||
return Request.CreateResponse(HttpStatusCode.OK);
|
||||
|
||||
Reference in New Issue
Block a user