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:
Nathan Heskew
2011-04-04 10:50:04 -07:00
parent 0605f0db28
commit 38f1039b7d
3 changed files with 5 additions and 5 deletions

View File

@@ -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]

View File

@@ -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);

View File

@@ -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));
}); });