mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Changing the usage of "slug" in error messages to "permalink" to match the field's label.
work item: 17417 --HG-- branch : 1.x
This commit is contained in:
@@ -72,12 +72,12 @@ namespace Orchard.Core.Tests.Routable.Services {
|
|||||||
|
|
||||||
var thing = contentManager.Create<Thing>("thing", t => {
|
var thing = contentManager.Create<Thing>("thing", t => {
|
||||||
t.As<RoutePart>().Record = new RoutePartRecord();
|
t.As<RoutePart>().Record = new RoutePartRecord();
|
||||||
t.Title = "Please do not use any of the following characters in your slugs: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \"\"\", \"<\", \">\"";
|
t.Title = "Please do not use any of the following characters in your permalink: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \"\"\", \"<\", \">\"";
|
||||||
});
|
});
|
||||||
|
|
||||||
_routableService.FillSlugFromTitle(thing.As<RoutePart>());
|
_routableService.FillSlugFromTitle(thing.As<RoutePart>());
|
||||||
|
|
||||||
Assert.That(thing.Slug, Is.EqualTo("please-do-not-use-any-of-the-following-characters-in-your-slugs"));
|
Assert.That(thing.Slug, Is.EqualTo("please-do-not-use-any-of-the-following-characters-in-your-permalink"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@@ -87,9 +87,9 @@ namespace Orchard.Core.Routable.Drivers {
|
|||||||
if ( !_routableService.IsSlugValid(part.Slug) ) {
|
if ( !_routableService.IsSlugValid(part.Slug) ) {
|
||||||
var slug = (part.Slug ?? String.Empty);
|
var slug = (part.Slug ?? String.Empty);
|
||||||
if ( slug.StartsWith(".") || slug.EndsWith(".") )
|
if ( slug.StartsWith(".") || slug.EndsWith(".") )
|
||||||
updater.AddModelError("Routable.Slug", T("The \".\" can't be used around routes."));
|
updater.AddModelError("Routable.Slug", T("The \".\" can't be used at either end of the permalink."));
|
||||||
else
|
else
|
||||||
updater.AddModelError("Routable.Slug", T("Please do not use any of the following characters in your slugs: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \", \"<\", \">\". No spaces are allowed (please use dashes or underscores instead)."));
|
updater.AddModelError("Routable.Slug", T("Please do not use any of the following characters in your permalink: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \", \"<\", \">\". No spaces are allowed (please use dashes or underscores instead)."));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Editor(part, shapeHelper);
|
return Editor(part, shapeHelper);
|
||||||
|
@@ -41,7 +41,7 @@ namespace Orchard.Core.Routable.Handlers {
|
|||||||
Action<RoutePart> processSlug = (
|
Action<RoutePart> processSlug = (
|
||||||
routable => {
|
routable => {
|
||||||
if (!_routableService.ProcessSlug(routable))
|
if (!_routableService.ProcessSlug(routable))
|
||||||
_services.Notifier.Warning(T("Slugs in conflict. \"{0}\" is already set for a previously created {2} so now it has the slug \"{1}\"",
|
_services.Notifier.Warning(T("Permalinks in conflict. \"{0}\" is already set for a previously created {2} so now it has the slug \"{1}\"",
|
||||||
routable.Slug, routable.GetEffectiveSlug(), routable.ContentItem.ContentType));
|
routable.Slug, routable.GetEffectiveSlug(), routable.ContentItem.ContentType));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user