mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Orchard.Pages: Fixing that the "create page" shouldn't promote a page to home page unless it's also published
This prevents SQL timeout and not having a home page content item
This commit is contained in:
@@ -99,10 +99,6 @@ namespace Orchard.Pages.Commands {
|
||||
}
|
||||
}
|
||||
|
||||
if (Homepage) {
|
||||
_homeAliasService.PublishHomeAlias(page);
|
||||
}
|
||||
|
||||
var layout = default(string);
|
||||
if (UseWelcomeText) {
|
||||
var text = T(
|
||||
@@ -196,7 +192,7 @@ Aliquam vel sem nibh. Suspendisse vel condimentum tellus.</p>").Text;
|
||||
}
|
||||
|
||||
// (Layout) Hackish way to access the LayoutPart on the page without having to declare a dependency on Orchard.Layouts.
|
||||
var layoutPart = ((dynamic) page).LayoutPart;
|
||||
var layoutPart = ((dynamic)page).LayoutPart;
|
||||
var bodyPart = page.As<BodyPart>();
|
||||
|
||||
if (bodyPart != null)
|
||||
@@ -209,6 +205,10 @@ Aliquam vel sem nibh. Suspendisse vel condimentum tellus.</p>").Text;
|
||||
|
||||
if (Publish) {
|
||||
_contentManager.Publish(page);
|
||||
|
||||
if (Homepage) {
|
||||
_homeAliasService.PublishHomeAlias(page);
|
||||
}
|
||||
}
|
||||
|
||||
Context.Output.WriteLine(T("Page created successfully.").Text);
|
||||
|
||||
Reference in New Issue
Block a user