When deleting media folder, delete all it's files and subfolders with files and move files to trash folder.
Depends on #274. Move all folder and subfolders files to trash folder and mark subfolders and files as deleted
Could be done in RC1.
Update release notes when done.
Sub-medias deleting added. Affects #495.
Fixed in 1.10.3+
- It is not possible to delete image folder (no matter empty or not) Steps: Create new folder (no matter images or files) -> try to delete it: error
- It is not possible to delete image if it was renamed using "Rename" function called from menu. Steps: upload image -> right mouse click on this image in the list -> rename -> rename it, save -> choose to delete it: error. If renaming is done in image edit modal, delete works ok.
Fix available from 1.10.4-beta3+
Fix available from 1.11.0-beta10+
Upload image-> open it for edit -> save: new image versions with new urls will be created (ok). Delete image: only current version images will be moved to trash, but history images - won't (exception in logs will be logged, MediaFiles.isMovedToTrash will be = 0, nextTry timestamp will be set). Also same exists with files. Issue doesn't exist if new version is created using re-upload as in this case urls are formed differently.
Example with one of images exception in logs:
2015-11-26 11:38:32.7371 Failed to move file with Id=35c93ceb-f8ee-4f6f-910d-a55c00bed23d.
Failed to copy object. SourceUrl: http://bettercms.blob.core.windows.net/bettercmsstaging/image/8b1ce7e5b10f4fe3a531868fd7e239c0/o_a113aa10d5c64afc93cbf5cedce377d0.jpg, DestinationUrl: http://bettercms.blob.core.windows.net/bettercmsstaging/trash/image/8b1ce7e5b10f4fe3a531868fd7e239c0/o_a113aa10d5c64afc93cbf5cedce377d0.jpg BetterCms.Core.Exceptions.Service.StorageException: Failed to copy object. SourceUrl: http://bettercms.blob.core.windows.net/bettercmsstaging/image/8b1ce7e5b10f4fe3a531868fd7e239c0/o_a113aa10d5c64afc93cbf5cedce377d0.jpg, DestinationUrl: http://bettercms.blob.core.windows.net/bettercmsstaging/trash/image/8b1ce7e5b10f4fe3a531868fd7e239c0/o_a113aa10d5c64afc93cbf5cedce377d0.jpg ---> Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase1 cmd, IRetryPolicy policy, OperationContext operationContext) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase1 cmd, IRetryPolicy policy, OperationContext operationContext)
at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.StartCopyFromBlob(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext)
at BetterCms.Module.WindowsAzureStorage.WindowsAzureStorageService.CopyObject(Uri sourceUri, Uri destinationUri)
--- End of inner exception stack trace ---
at BetterCms.Module.WindowsAzureStorage.WindowsAzureStorageService.CopyObject(Uri sourceUri, Uri destinationUri)
at BetterCms.Module.MediaManager.Services.DefaultMediaFileService.MoveToTrash(ISession session, MediaFile fileToMove, String serverUrl)
The remote server returned an error: (404) Not Found. Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase1 cmd, IRetryPolicy policy, OperationContext operationContext) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase1 cmd, IRetryPolicy policy, OperationContext operationContext)
at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.StartCopyFromBlob(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, BlobRequestOptions options, OperationContext operationContext)
at BetterCms.Module.WindowsAzureStorage.WindowsAzureStorageService.CopyObject(Uri sourceUri, Uri destinationUri)
Request Information
RequestID:5ace7597-0001-005d-3e3e-28c317000000
RequestDate:Thu, 26 Nov 2015 11:38:31 GMT
StatusMessage:The specified blob does not exist.
ErrorCode:BlobNotFound
Fix after #1055