For some time there has been a really annoying 'feature' of Umbraco where if you delete an item in the media section of Umbraco and then clear it from the recycle bin, the image is cleared from Umbraco but is still left in a media folder on the server.
Does anyone know what event I can hook into to delete these leftover folders on the server? Ideally I would like to hook into the 'Empty recycle bin' event so that the items are deleted from the server like they should have been all along.
Can't help you but I can confirm that this also happens in the media recycle bin.
I deleted 33k media nodes using the media service and they are still there in the recycle bin.
mediaservice.EmptyRecyclebin() crashes with
This SqlTransaction has completed; it is no longer usable.
I got the same crash working from the Umbraco Office media dashboard.
Delete / empty recycle bin event in Umbraco
Hi all,
For some time there has been a really annoying 'feature' of Umbraco where if you delete an item in the media section of Umbraco and then clear it from the recycle bin, the image is cleared from Umbraco but is still left in a media folder on the server.
Does anyone know what event I can hook into to delete these leftover folders on the server? Ideally I would like to hook into the 'Empty recycle bin' event so that the items are deleted from the server like they should have been all along.
Any help / pointers would be greatly appreciated.
Can't help you but I can confirm that this also happens in the media recycle bin. I deleted 33k media nodes using the media service and they are still there in the recycle bin. mediaservice.EmptyRecyclebin() crashes with This SqlTransaction has completed; it is no longer usable.
I got the same crash working from the Umbraco Office media dashboard.
Classic Umbraco. It's a known bug. Using 7.2.8
This method worked for me:
private static void CheckGalleryFiles(ApplicationContext context) { var mediaService = context.Services.MediaService; var recycled = mediaService.GetMediaInRecycleBin(); foreach (var re in recycled) { Console.WriteLine("Deleting {0}", re.Name); mediaService.Delete(re); } }
The console writeline is there as it takes a long time and you'll go mad waiting otherwise. The Umbraco back office now shows an empty recycle bin
is working on a reply...