mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Newly translated content w/out a PublishLaterPart is now published if the master content item is published
--HG-- branch : dev
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Core.Localization.Models;
|
||||
using Orchard.Core.Localization.Services;
|
||||
using Orchard.Core.Localization.ViewModels;
|
||||
@@ -9,6 +10,7 @@ using Orchard.Localization;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Mvc.Results;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Core.Localization.Controllers {
|
||||
[ValidateInput(false)]
|
||||
@@ -75,6 +77,10 @@ namespace Orchard.Core.Localization.Controllers {
|
||||
localized.MasterContentItem = contentItem;
|
||||
localized.Culture = _cultureManager.GetCultureByName(viewModel.SelectedCulture);
|
||||
_contentManager.Create(contentItemTranslation, VersionOptions.Draft);
|
||||
|
||||
if (!contentItem.Has<IPublishingControlAspect>() && contentItem.VersionRecord != null && contentItem.VersionRecord.Published) {
|
||||
_contentManager.Publish(contentItemTranslation);
|
||||
}
|
||||
}
|
||||
|
||||
if (ModelState.IsValid)
|
||||
@@ -87,6 +93,8 @@ namespace Orchard.Core.Localization.Controllers {
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
Services.Notifier.Information(T("Created content item translation"));
|
||||
|
||||
var metadata = _contentManager.GetItemMetadata(viewModel.Content.Item);
|
||||
if (metadata.EditorRouteValues == null)
|
||||
return null; //todo: (heskew) redirect to somewhere better than nowhere
|
||||
|
Reference in New Issue
Block a user