From 6e49ad2ce283e1358ca2aee1ca716f80f093bcba Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 20 May 2014 20:04:19 +0200 Subject: [PATCH] Changed the Template title syntax requirements. This change makes it possible to use "complex" shape names (e.g. "Email__Wrapper"). Before this change, the shape file name syntax was required (e.g. "Email-Wrapper"). However, such shapes would not be found when using the {Shape.Execute} token when using the other syntax (e.g. "Email__Wrapper"), since TemplateShapeDisplayEvent simply register the shapes by specified title without first translating the file based syntax to code based syntax. --- .../Modules/Orchard.Templates/Drivers/ShapePartDriver.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Templates/Drivers/ShapePartDriver.cs b/src/Orchard.Web/Modules/Orchard.Templates/Drivers/ShapePartDriver.cs index d0bf0083b..0cd70d87f 100644 --- a/src/Orchard.Web/Modules/Orchard.Templates/Drivers/ShapePartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Templates/Drivers/ShapePartDriver.cs @@ -70,13 +70,13 @@ namespace Orchard.Templates.Drivers { return false; var name = titleViewModel.Title; - if (!string.IsNullOrWhiteSpace(name) && + if (!String.IsNullOrWhiteSpace(name) && name[0].IsLetter() && - name.All(c => c.IsLetter() || Char.IsDigit(c) || c == '.' || c == '-')) { + name.All(c => c.IsLetter() || Char.IsDigit(c) || c == '_')) { return true; } - updater.AddModelError("Title", T("{0} names can only contain alphanumerical, dot (.) or dash (-) characters and have to start with a letter.", part.ContentItem.TypeDefinition.DisplayName)); + updater.AddModelError("Title", T("{0} names can only contain alphanumerical or underscore (_) characters and have to start with a letter.", part.ContentItem.TypeDefinition.DisplayName)); return false; }