Ensure folder does not contain files during deletion and remove directory during deletion, fix validation issue in add page which would allow a user to create a page without selecting a layout, modify action dialog to use its own CSS class name so it can be styled independently from the Admin Modal, rollback "container" CSS class assigment on panes

This commit is contained in:
Shaun Walker
2020-08-26 15:00:07 -04:00
parent 6cc144d733
commit 760fc3b8d4
8 changed files with 50 additions and 11 deletions

View File

@ -214,6 +214,11 @@ namespace Oqtane.Controllers
{
if (_userPermissions.IsAuthorized(User, EntityNames.Folder, id, PermissionNames.Edit))
{
Models.Folder _folder = _folders.GetFolder(id, false);
if (Directory.Exists(GetFolderPath(_folder)))
{
Directory.Delete(GetFolderPath(_folder));
}
_folders.DeleteFolder(id);
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Folder Deleted {FolderId}", id);
}