mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Corrected layer unicity test
--HG-- branch : dev
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user