Corrected layer unicity test

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-10-19 14:48:04 -07:00
parent 0a19a7a0c7
commit d6f77feeba

View File

@@ -340,7 +340,7 @@ namespace Orchard.Widgets.Controllers {
layer.LayerRule = "true";
}
if(_widgetsService.GetLayers().Any(l => String.CompareOrdinal(l.Name, layer.Name) == 0)) {
if(_widgetsService.GetLayers().Count(l => String.Equals(l.Name, layer.Name, StringComparison.InvariantCultureIgnoreCase)) > 1) { // the current layer counts for 1
ModelState.AddModelError("Name", T("A Layer with the same name already exists").Text);
return false;
}