bishop335 / subtext

Automatically exported from code.google.com/p/subtext
0 stars 0 forks source link

Gallery cannot be deleted if an image was deleted manually #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1) Create a gallery & upload an image
2) Manual delete the image from the folder
3) Try to delete the gallery in the admin console
4) Error: see attached screen shot

What is the expected output? What do you see instead?
If i am deleting the gallery shouldn't it be okay if the image is already 
deleted. Also the errormessage is misleading, it says access denied.

What version of the product are you using? On what operating system?
2.1.0.5

Original issue reported on code.google.com by osbo...@gmail.com on 23 Mar 2010 at 4:49

Attachments:

GoogleCodeExporter commented 9 years ago
This must have been because of the following code in the 2.1x version:

string galleryFolder = Images.LocalGalleryFilePath(_targetID);
if (Directory.Exists(galleryFolder))
Directory.Delete(galleryFolder, true);

As above, even though file path is returned, only the existence of the 
directory is
checked before proceeding to delete. The latest trunk handles this as follows:

string galleryFolder = GalleryDirectoryPath;
if(Directory.Exists(galleryFolder))
{
     Directory.Delete(galleryFolder, true);
}

However, the directory.exists always returns false and the directory is  not 
deleted.
I will file another bug (two, in fact) detailing the gallery delete 
functionality.

Original comment by shankarkrupa@gmail.com on 23 Mar 2010 at 8:40

GoogleCodeExporter commented 9 years ago
Patch that uses Server.MapPath to specify the full path for the folder to 
delete from the file system.

Original comment by nil...@gmail.com on 14 Sep 2010 at 5:57

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r4189

Original comment by haac...@gmail.com on 15 May 2011 at 11:14

GoogleCodeExporter commented 9 years ago

Original comment by Simon.JPhilp on 29 May 2011 at 4:36