mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Using Path on IsRoutable directly in the driver & handler
--HG-- branch : dev
This commit is contained in:
@@ -55,7 +55,7 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
};
|
||||
|
||||
// TEMP: path format patterns replaces this logic
|
||||
var path = part.Record.Path;
|
||||
var path = part.Path;
|
||||
if (path != null && path.EndsWith(part.Slug)) {
|
||||
model.DisplayLeadingPath = path.Substring(0, path.Length - part.Slug.Length);
|
||||
}
|
||||
@@ -73,10 +73,10 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
// TEMP: path format patterns replaces this logic
|
||||
var containerSlug = GetContainerSlug(part);
|
||||
if (string.IsNullOrEmpty(containerSlug)) {
|
||||
part.Record.Path = model.Slug;
|
||||
part.Path = model.Slug;
|
||||
}
|
||||
else {
|
||||
part.Record.Path = containerSlug + "/" + model.Slug;
|
||||
part.Path = containerSlug + "/" + model.Slug;
|
||||
}
|
||||
|
||||
if (!_routableService.IsSlugValid(part.Slug)) {
|
||||
|
@@ -12,7 +12,7 @@ namespace Orchard.Core.Routable.Handlers {
|
||||
_routablePathConstraint = routablePathConstraint;
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
|
||||
OnPublished<IsRoutable>((context, routable) => _routablePathConstraint.AddPath(routable.Record.Path));
|
||||
OnPublished<IsRoutable>((context, routable) => _routablePathConstraint.AddPath(routable.Path));
|
||||
}
|
||||
}
|
||||
public class IsRoutableHandler : ContentHandlerBase {
|
||||
@@ -23,7 +23,7 @@ namespace Orchard.Core.Routable.Handlers {
|
||||
{"Area", "Routable"},
|
||||
{"Controller", "Item"},
|
||||
{"Action", "Display"},
|
||||
{"path", routable.Record.Path}
|
||||
{"path", routable.Path}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user