mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
Making it so multiple warning messages don't appear when creating a new container enabled content item (messages which appear when there are no containable enabled content types in the system)
work item: 16905 --HG-- branch : dev
This commit is contained in:
@@ -35,16 +35,16 @@ namespace Orchard.Core.Containers.Drivers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) {
|
protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) {
|
||||||
return Editor(part, null, shapeHelper);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override DriverResult Editor(ContainerPart part, IUpdateModel updater, dynamic shapeHelper) {
|
|
||||||
// if there are no containable items then show a nice little warning
|
// if there are no containable items then show a nice little warning
|
||||||
if (!_contentDefinitionManager.ListTypeDefinitions()
|
if (!_contentDefinitionManager.ListTypeDefinitions()
|
||||||
.Where(typeDefinition => typeDefinition.Parts.Any(partDefinition => partDefinition.PartDefinition.Name == "ContainablePart")).Any()) {
|
.Where(typeDefinition => typeDefinition.Parts.Any(partDefinition => partDefinition.PartDefinition.Name == "ContainablePart")).Any()) {
|
||||||
Services.Notifier.Warning(T("There are no content types in the system with a Containable part attached. Consider adding a Containable part to some content type, existing or new, in order to relate items to this (Container enabled) item."));
|
Services.Notifier.Warning(T("There are no content types in the system with a Containable part attached. Consider adding a Containable part to some content type, existing or new, in order to relate items to this (Container enabled) item."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Editor(part, null, shapeHelper);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override DriverResult Editor(ContainerPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||||
return ContentShape(
|
return ContentShape(
|
||||||
"Parts_Container_Edit",
|
"Parts_Container_Edit",
|
||||||
() => {
|
() => {
|
||||||
|
Reference in New Issue
Block a user