mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 17:51:45 +08:00
[Fixes #4723] Orchard.Core.Contents - Verify type exists on create content
Fixes #4723, #6769
This commit is contained in:
committed by
Sébastien Ros
parent
951c36a59b
commit
3e275f3f22
@@ -241,6 +241,10 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
if (string.IsNullOrEmpty(id))
|
||||
return CreatableTypeList(containerId);
|
||||
|
||||
if (_contentDefinitionManager.GetTypeDefinition(id) == null) {
|
||||
return RedirectToAction("Create", new { id = "" });
|
||||
}
|
||||
|
||||
var contentItem = _contentManager.New(id);
|
||||
|
||||
if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot create content")))
|
||||
|
||||
Reference in New Issue
Block a user