Try our conversational search powered by Generative AI!

Content type "MyBlock" is not allowed to be created under parent of content type "SysContentAssetFolder"

Vote:
 

Hi, I've create a new block, but when I'm trying to add it on a page, I receive the next exception:

Exception information:
Exception type: EPiServerException
Exception message: Content type "MyBlock" is not allowed to be created under parent of content type "SysContentAssetFolder"
at EPiServer.Core.DefaultContentRepository.ValidateContentTypeAvailability(IContent content)
at EPiServer.Core.DefaultContentRepository.Save(IContent content, SaveAction action, AccessLevel access)
at EPiServer.IContentRepositoryExtension.Save(IContentRepository repository, IContent content, SaveAction action)
at EPiServer.Cms.Shell.UI.Rest.ContentChangeManager.CreateContent(ContentReference parentLink, Int32 contentTypeId, Nullable`1 resourceFolderId, Boolean createAsLocalAsset, String name, IDictionary`2 properties, SaveAction saveAction)
at EPiServer.Cms.Shell.UI.Rest.ContentChangeManager.Create(ContentReference parentLink, Int32 contentTypeId, Nullable`1 resourceFolderId, Boolean createAsLocalAsset, String name, IDictionary`2 properties, Boolean autoPublish)
at EPiServer.Cms.Shell.UI.Rest.ContentDataStore.Post(PostContentModel entity)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<>c__DisplayClass17.b__14()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<>c__DisplayClass17.b__14()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at EPiServer.Shell.Services.Rest.RestControllerBase.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
at EPiServer.Shell.Services.Rest.RestHttpHandler.ProcessRequest(HttpContextBase httpContext)
at EPiServer.Shell.Services.Rest.RestHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Block has very simple implementation:

[ContentType(GroupName = "....", GUID = ".....")]
public class MyBlock : EPiServer.Core.BlockData
{
}

Does anyone have any ideas what can be a reason of such behavior?

#123204
Jun 26, 2015 15:42
Vote:
 

You have created shared block and adding it to page's content area? Or created new local block (in "For This Page" folder) and then trying to add to content area?

#123214
Jun 27, 2015 10:44
Vote:
 

I'm trying to create a new block "for this page"

#123217
Jun 28, 2015 11:16
Vote:
 

We have the same issue. It doesn't affect all blocks, only newly created, even copies of old fully functional blocks get the same error.

But as NickT indicates this issue only affects new blocks on the page and not the shared blocks section. 

#142626
Dec 16, 2015 14:28
Vote:
 
#142627
Dec 16, 2015 14:29
Vote:
 

Problem was solved by removing all rows in "tblContentTypeToContentType" referring to the row in "tblContentType" with the ModelType "EPiServer.Core.ContentAssetFolder,EPiServer", in this case pkID 4.

DELETE FROM tblContentTypeToContentType
WHERE fkContentTypeParentID = 4

After that, do a iisreset and it works as it should again.

#142699
Dec 18, 2015 14:39
Vote:
 

Thanks Nicklas! I just encountered the same issue on our development server. Google pointed me to this thread and your SQL query seems to have fixed the issue perfectly!
This was on EPiServer 9.12.2 at 2017-03-09. We haven't yet taken the step to go to EPiServer 10.

#176073
Mar 09, 2017 11:47
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.