diff --git a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs index 6dd253855..0d17681cb 100644 --- a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs @@ -249,14 +249,15 @@ namespace Orchard.Core.Contents.Controllers { if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't create content"))) return new HttpUnauthorizedResult(); - _contentManager.Create(contentItem, VersionOptions.Draft); - var model = _contentManager.UpdateEditor(contentItem, this); + if (!ModelState.IsValid) { _transactionManager.Cancel(); return View(model); } + _contentManager.Create(contentItem, VersionOptions.Draft); + conditionallyPublish(contentItem); Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs b/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs index 840377360..7bbea8484 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs +++ b/src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs @@ -27,11 +27,8 @@ namespace Orchard.Comments.Controllers { return this.RedirectLocal(returnUrl, "~/"); var comment = Services.ContentManager.New("Comment"); - Services.ContentManager.Create(comment, VersionOptions.Draft); - var editorShape = Services.ContentManager.UpdateEditor(comment, this); - if (!ModelState.IsValidField("Comments.Author")) { Services.Notifier.Error(T("Name is mandatory and must have less than 255 chars")); } diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Parts/Media.SummaryAdmin.cshtml b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Parts/Media.SummaryAdmin.cshtml index 017bcaa3e..d0fe8c705 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Parts/Media.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Parts/Media.SummaryAdmin.cshtml @@ -11,7 +11,7 @@ @if (HasText(mediaUrl)) {
@T("Filename:") - @Path.GetFileName(mediaUrl) + @HttpUtility.UrlDecode(Path.GetFileName(mediaUrl))
}
diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs index 480959317..d572c053b 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs @@ -58,8 +58,10 @@ namespace Orchard.MediaProcessing.Services { public string GetImageProfileUrl(string path, string profileName, FilterRecord customFilter, ContentItem contentItem) { + // path is the publicUrl of the media, so it might contain url-encoded chars + // try to load the processed filename from cache - var filePath = _fileNameProvider.GetFileName(profileName, path); + var filePath = _fileNameProvider.GetFileName(profileName, System.Web.HttpUtility.UrlDecode(path)); bool process = false; // if the filename is not cached, process it diff --git a/src/Orchard.Web/Modules/Orchard.Workflows/Handlers/WorkflowContentHandler.cs b/src/Orchard.Web/Modules/Orchard.Workflows/Handlers/WorkflowContentHandler.cs index 451436704..ef4db183a 100644 --- a/src/Orchard.Web/Modules/Orchard.Workflows/Handlers/WorkflowContentHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Workflows/Handlers/WorkflowContentHandler.cs @@ -33,9 +33,17 @@ namespace Orchard.Workflows.Handlers { () => new Dictionary { { "Content", context.ContentItem } })); OnUpdated( - (context, part) => - workflowManager.TriggerEvent("ContentUpdated", context.ContentItem, - () => new Dictionary { { "Content", context.ContentItem } })); + (context, part) => { + if(context.ContentItemRecord == null) { + return; + } + + workflowManager.TriggerEvent( + "ContentUpdated", + context.ContentItem, + () => new Dictionary { { "Content", context.ContentItem } } + ); + }); } } } \ No newline at end of file