Try our conversational search powered by Generative AI!

Exception: Failed to load content type with name 'CategoryData' when working with Geta.EpiCategories plugin

Vote:
 

I've been struggling with an exception while I'm trying to import the package to one of the websites -

This has been due to the plugin installed - https://github.com/Geta/EpiCategories

So it's expecting a ContentType named 'CategoryData' which in my case I've two/category - 

 [ContentType]
    public class PressCategory : CategoryData
    {
    }

    [ContentType]
    public class GuestReportingCategory : CategoryData
    {
    }

And the block has a property that basically overrides the default Category of page/block

Any idea what may have happened?

#206461
Aug 21, 2019 17:45
Vote:
 

Hi Manoj,

You might want to create a hotfix around this issue like this not explained well on Geta's plugin document here - https://github.com/Geta/EpiCategories

So I can guess from the error you received above is that it is searching for a registered contentType "CategoryData" which it cannot find in the system.

So you can use the base class from EPiServer.Core.StandardContentBase that will do the rest for you. It'll will register CategoryData as a ContentType.

[ContentType]
public class CategoryData:StandardContentBase
{
}

However, If you look into the definition of inherited CategoryData base class (on your code) you will note that it exactly inherit the StandardContentBase but the keynote here is to decorate it with [ContentType] attribute. Which was missing in the original document.

Regards

Ravindra

#206480
Aug 22, 2019 10:05
Tim Schmelter - Nov 10, 2023 18:06
I don't understand this solution and i wonder if the issue is fixed in the meantime.
According to this, it should be fixed for EpiCategiories:
https://github.com/Geta/EpiCategories/issues/23
But i'm using the new geta optimizely categories:
https://github.com/Geta/geta-optimizely-categories

When i try to import a lot of pages(100MB) i get this error:
2023-11-10 18:56:49.517 +01:00 [ERR] 10.5.3 Export/import error: Exception: Failed to load content type with name 'CategoryData'
EPiServer.DataAbstraction.DataAbstractionException: Failed to load content type with name 'CategoryData'
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeMappingAnalyzer.GetContentType(String contentTypeName)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeMappingAnalyzer.Analyze(ContentType contentType, AvailableSetting settings, IContentTypeAvailableModelSetting modelsetting)
at EPiServer.DataAbstraction.Internal.AvailableSettingsRepository.RegisterSetting(ContentType contentType, AvailableSetting setting)
at EPiServer.Enterprise.Transfer.Internal.AllowedContentTypesTransfer.ImportInternal(IEnumerable`1 transferObjects)
at EPiServer.Enterprise.Transfer.Internal.AllowedContentTypesTransfer.Import(XmlTextReader input)
at EPiServer.Enterprise.Internal.DefaultDataImporter.ImportStream(ZipPackage package, XmlTextReader reader, String partName, ImportOptions options)
at EPiServer.Enterprise.Internal.DefaultDataImporter.ImportPartOfPackage(ZipPackage package, String partName, ImportOptions options)
at EPiServer.Enterprise.Internal.DefaultDataImporter.ImportRaw(ZipPackage package, ImportOptions options)
at EPiServer.Enterprise.Internal.DefaultDataImporter.Import(ImportOptions options)

So what can i do to prevent it? By the way, i added another question since it's CMS-12:
https://world.optimizely.com/forum/developer-forum/cms-12/thread-container/2023/11/exception-failed-to-load-content-type-with-name-categorydata-when-working-with-geta-optimizely-categories-plugin/
Vote:
 

Bingo!

Hey Ravindra, You nailed it! Thanks for putting your efforts.

#206483
Aug 22, 2019 11:02
Vote:
 

I am glad to know that this helps

#206570
Aug 24, 2019 9:59
Vote:
 

Out of curiosity, did you import content into a site that doesn't have EpiCategories installed? If not, do you have a GUID specified (you always should) for your Category content types? I have never had these issues as long as content types match between exporting and importing site.

If EpiCategories was not installed on the target site, did you include content types in your export package? However, I don't see the point in exporting/importing content types between sites these days since they are defined in code.

#207141
Sep 11, 2019 10:55
willwon155 - Jan 08, 2020 9:57
Thanks, Sir for giving this information it's very helpful for us and if you live in Dubai and you want to repair your printer please visit our services: Brother Printer Repair
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.