mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Deleting media files was broke. And when it failed, it double failed with a NullReferenceException while redirecting you.
--HG-- branch : dev
This commit is contained in:
@@ -102,7 +102,7 @@ namespace Orchard.Media.Controllers {
|
|||||||
string folderName = input[fileName];
|
string folderName = input[fileName];
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageMedia, T("Couldn't delete media file")))
|
if (!Services.Authorizer.Authorize(Permissions.ManageMedia, T("Couldn't delete media file")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
_mediaService.DeleteFile(fileName, folderName);
|
_mediaService.DeleteFile(folderName, fileName);
|
||||||
|
|
||||||
Services.Notifier.Information(T("Media file deleted"));
|
Services.Notifier.Information(T("Media file deleted"));
|
||||||
}
|
}
|
||||||
@@ -119,8 +119,7 @@ namespace Orchard.Media.Controllers {
|
|||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index");
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
this.Error(exception, T("Deleting failed: {0}", exception.Message), Logger, Services.Notifier);
|
this.Error(exception, T("Deleting failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||||
|
return RedirectToAction("Index");
|
||||||
return View();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user