Fixing that the technical names of widgets couldn't contain hyphens, see #4981

This commit is contained in:
Lombiq
2015-05-11 16:52:54 +02:00
committed by Zoltán Lehóczky
parent 73336e19ba
commit 91e040e684
2 changed files with 29 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ namespace Orchard.Widgets.Drivers {
// if there is a name, ensure it's unique
if(!string.IsNullOrWhiteSpace(widgetPart.Name)) {
widgetPart.Name = widgetPart.Name.ToSafeName();
widgetPart.Name = widgetPart.Name.ToHtmlName();
var widgets = _contentManager.Query<WidgetPart, WidgetPartRecord>().Where(x => x.Name == widgetPart.Name && x.Id != widgetPart.Id).Count();
if(widgets > 0) {