mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-24 18:25:04 +08:00
Merge branch 'refs/heads/1.10.x' into dev
This commit is contained in:
@@ -11,6 +11,7 @@ using Orchard.MediaLibrary.Models;
|
|||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Orchard.FileSystems.Media;
|
using Orchard.FileSystems.Media;
|
||||||
|
using Orchard.Logging;
|
||||||
|
|
||||||
namespace Orchard.MediaLibrary.Controllers {
|
namespace Orchard.MediaLibrary.Controllers {
|
||||||
[Admin, Themed(false)]
|
[Admin, Themed(false)]
|
||||||
@@ -26,10 +27,12 @@ namespace Orchard.MediaLibrary.Controllers {
|
|||||||
_mimeTypeProvider = mimeTypeProvider;
|
_mimeTypeProvider = mimeTypeProvider;
|
||||||
Services = orchardServices;
|
Services = orchardServices;
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
|
Logger = NullLogger.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IOrchardServices Services { get; set; }
|
public IOrchardServices Services { get; set; }
|
||||||
public Localizer T { get; set; }
|
public Localizer T { get; set; }
|
||||||
|
public ILogger Logger { get; set; }
|
||||||
|
|
||||||
public ActionResult Index(string folderPath, string type, int? replaceId = null) {
|
public ActionResult Index(string folderPath, string type, int? replaceId = null) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageOwnMedia)) {
|
if (!Services.Authorizer.Authorize(Permissions.ManageOwnMedia)) {
|
||||||
@@ -110,6 +113,7 @@ namespace Orchard.MediaLibrary.Controllers {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
Logger.Error(ex, "Unexpected exception when uploading a media.");
|
||||||
statuses.Add(new {
|
statuses.Add(new {
|
||||||
error = T(ex.Message).Text,
|
error = T(ex.Message).Text,
|
||||||
progress = 1.0,
|
progress = 1.0,
|
||||||
@@ -189,6 +193,8 @@ namespace Orchard.MediaLibrary.Controllers {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
Logger.Error(ex, "Unexpected exception when uploading a media.");
|
||||||
|
|
||||||
statuses.Add(new {
|
statuses.Add(new {
|
||||||
error = T(ex.Message).Text,
|
error = T(ex.Message).Text,
|
||||||
progress = 1.0,
|
progress = 1.0,
|
||||||
|
|||||||
Reference in New Issue
Block a user