#18463: Fixing import calling Publish before exexuting import handlers

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-02-23 13:42:22 -08:00
parent d3326d575e
commit c80bc78feb
5 changed files with 38 additions and 11 deletions

View File

@@ -38,12 +38,6 @@ namespace Orchard.Recipes.RecipeHandlers {
var item = importContentSession.Get(identity);
if (item == null) {
item = _orchardServices.ContentManager.New(element.Name.LocalName);
if (status != null && status.Value == "Draft") {
_orchardServices.ContentManager.Create(item, VersionOptions.Draft);
}
else {
_orchardServices.ContentManager.Create(item);
}
}
else {
item = _orchardServices.ContentManager.Get(item.Id, VersionOptions.DraftRequired);

View File

@@ -55,4 +55,23 @@
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
theme activate "The Theme Machine"
</Command>
<Data>
<Page Id="/alias=about-us" Status="Published">
<CommonPart Owner="/User.UserName=admin" CreatedUtc="2012-02-14T19:22:13Z" PublishedUtc="2012-02-14T19:22:13Z" ModifiedUtc="2012-02-14T19:22:13Z" />
<BodyPart Text="&lt;p&gt;This is the about page.&lt;/p&gt;" />
<AutoroutePart UseCustomPattern="false" Alias="about-us" />
<MenuPart MenuText="About Us" MenuPosition="2" OnMainMenu="true" />
<TagsPart Tags="" />
<TitlePart Title="About Us" />
</Page>
<Page Status="Published" Id="/alias=contact-us">
<CommonPart ModifiedUtc="2012-02-22T19:20:20Z" PublishedUtc="2012-02-22T19:20:20Z" CreatedUtc="2012-02-22T19:20:20Z" Owner="/User.UserName=admin"/>
<BodyPart Text="&lt;p&gt;This is the Contact Us page.&lt;/p&gt;"/>
<AutoroutePart UseCustomPattern="false" Alias="contact-us"/>
<MenuPart OnMainMenu="true" MenuText="Contact Us" MenuPosition="3"/>
<TagsPart Tags=""/>
<TitlePart Title="Contact Us"/>
</Page>
</Data>
</Orchard>