diff --git a/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs b/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs index c33b53dda..8e1676a86 100644 --- a/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs +++ b/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs @@ -10,6 +10,7 @@ using Orchard.ContentManagement.Handlers; using Orchard.ContentManagement.MetaData; using Orchard.ContentManagement.Records; using Orchard.Core.Common.Models; +using Orchard.Core.Routable; using Orchard.Core.Routable.Handlers; using Orchard.Core.Routable.Models; using Orchard.Core.Routable.Services; @@ -35,6 +36,7 @@ namespace Orchard.Core.Tests.Common.Services { builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As(); + builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterInstance(new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData()))).As(); diff --git a/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs b/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs index 3c475aa04..7ea971dd4 100644 --- a/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs +++ b/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs @@ -12,7 +12,10 @@ namespace Orchard.Core.Routable.Handlers { _routablePathConstraint = routablePathConstraint; Filters.Add(StorageFilter.For(repository)); - OnPublished((context, routable) => _routablePathConstraint.AddPath(routable.Path)); + OnPublished((context, routable) => { + if (!string.IsNullOrEmpty(routable.Path)) + _routablePathConstraint.AddPath(routable.Path); + }); } } public class IsRoutableHandler : ContentHandlerBase {