2

When trying to publish a dynamic component or preview a dynamic component I receive an error: Could not create an instance of type DD4T.ContentModel.IKeyword

The paths referenced are different depending on the component, but the error is the same. Has anybody else run into this issue?

There was no change in the component or the code that is referenced as far as I can see between the previous version and this one.

<tcm:Error ErrorCode="80040356" Category="18" Source="Kernel" xmlns:tcm="http://www.tridion.com/ContentManager/5.0"><tcm:Line ErrorCode="80040356" Cause="true"><![CDATA[Could not create an instance of type DD4T.ContentModel.IKeyword. Type is an interface or abstract class and cannot be instantiated. Path 'Component.Fields.panels.LinkedComponentValues[1].Fields.link.EmbeddedValues[0].Link.LinkedComponentValues[0].Fields.CTAs.EmbeddedValues[0].Link.LinkedComponentValues[0].Categories[2].Keywords[0].ParentKeywords[0].IsRoot', line 1, position 28829.]]></tcm:Line></tcm:Error>

1 Answer 1

1

I added a custom converter to convert the IKeyword to Keyword during deserialization.

public class KeywordConverter : CustomCreationConverter<IKeyword>
{
    public override IKeyword Create(Type objectType)
    {
        return new Keyword();
    }
}

Then in BaseTemplate I added the custom converter to the Serializer if the serializer type is JSONSerializerService

Now it's working again.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.