mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge branch '1.8.x' into 1.x
This commit is contained in:
@@ -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)
|
||||
|
@@ -27,11 +27,8 @@ namespace Orchard.Comments.Controllers {
|
||||
return this.RedirectLocal(returnUrl, "~/");
|
||||
|
||||
var comment = Services.ContentManager.New<CommentPart>("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"));
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
@if (HasText(mediaUrl)) {
|
||||
<div class="file-name">
|
||||
<em>@T("Filename:")</em>
|
||||
<span><a href="@mediaUrl">@Path.GetFileName(mediaUrl)</a></span>
|
||||
<span><a href="@mediaUrl">@HttpUtility.UrlDecode(Path.GetFileName(mediaUrl))</a></span>
|
||||
</div>
|
||||
}
|
||||
<div class="mime-type">
|
||||
|
@@ -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
|
||||
|
@@ -33,9 +33,17 @@ namespace Orchard.Workflows.Handlers {
|
||||
() => new Dictionary<string, object> { { "Content", context.ContentItem } }));
|
||||
|
||||
OnUpdated<ContentPart>(
|
||||
(context, part) =>
|
||||
workflowManager.TriggerEvent("ContentUpdated", context.ContentItem,
|
||||
() => new Dictionary<string, object> { { "Content", context.ContentItem } }));
|
||||
(context, part) => {
|
||||
if(context.ContentItemRecord == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
workflowManager.TriggerEvent(
|
||||
"ContentUpdated",
|
||||
context.ContentItem,
|
||||
() => new Dictionary<string, object> { { "Content", context.ContentItem } }
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user