diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Services/XmlRpcHandler.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Services/XmlRpcHandler.cs index 00c9b3e68..820a45236 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Services/XmlRpcHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Services/XmlRpcHandler.cs @@ -9,6 +9,7 @@ using Orchard.ContentManagement; using Orchard.ContentManagement.Aspects; using Orchard.Core.Common.Models; using Orchard.Core.Routable.Models; +using Orchard.Core.Routable.Services; using Orchard.Core.XmlRpc; using Orchard.Core.XmlRpc.Models; using Orchard.Environment.Extensions; @@ -26,16 +27,18 @@ namespace Orchard.Blogs.Services { private readonly IContentManager _contentManager; private readonly IAuthorizationService _authorizationService; private readonly IMembershipService _membershipService; + private readonly IRoutableService _routableService; private readonly RouteCollection _routeCollection; public XmlRpcHandler(IBlogService blogService, IBlogPostService blogPostService, IContentManager contentManager, - IAuthorizationService authorizationService, IMembershipService membershipService, + IAuthorizationService authorizationService, IMembershipService membershipService, IRoutableService routableService, RouteCollection routeCollection) { _blogService = blogService; _blogPostService = blogPostService; _contentManager = contentManager; _authorizationService = authorizationService; _membershipService = membershipService; + _routableService = routableService; _routeCollection = routeCollection; Logger = NullLogger.Instance; } @@ -169,19 +172,20 @@ namespace Orchard.Blogs.Services { blogPost.As().Text = description; } - //RoutePart - if (blogPost.Is()) { - blogPost.As().Title = title; - blogPost.As().Slug = slug; - blogPost.As().Path = blogPost.As().GetPathFromSlug(slug); - } - //CommonPart if (blogPost.Is()) { blogPost.As().Owner = user; blogPost.As().Container = blog; } + //RoutePart + if (blogPost.Is()) { + blogPost.As().Title = title; + blogPost.As().Slug = slug; + _routableService.FillSlug(blogPost.As()); + blogPost.As().Path = blogPost.As().GetPathFromSlug(blogPost.As().Slug); + } + _contentManager.Create(blogPost.ContentItem, VersionOptions.Draft); if (publish)