Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bhawna Jain 17 posts 148 karma points
    Jun 06, 2019 @ 06:47
    Bhawna Jain
    0

    Factory returned model of type which does not implement IPublishedContent.

    I am not able to save any of my content page and hence not able to publish them (refer the attached image).

    Things which I have tried so far:

    1. Changing "Umbraco.ModelsBuilder.ModelsMode" to Dll, LiveDll and PureLive.
    2. Cleared nu cache.

    This issue have appeared before in my project, but at that time I changed the mode to live which allowed me to save & publish the content, then switching back to Dll solved it. But this time, I have tried every combination but still not able to solve it.

    enter image description here

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Jun 09, 2019 @ 16:22
    Marc Goodson
    0

    Hi Bhawna

    The generated models in Modelsbuilder are designed to implement IPublishedContent...

    What properties do you have on BlogLandingPage document type?

    The odd thought I had is maybe a custom property you have defined on the doc type - clashes in name with one on IPublishedContent, but with a different signature, and therefore is generating a version of the model that now doesn't implement IPublishedContent properly!

    Are there any errors logged when you regenerated models?

    Has the BlogLandingPage got 'Is Element Type' ticked for it in the 'permissions section'

    regards

    Marc

  • Bhawna Jain 17 posts 148 karma points
    Jun 17, 2019 @ 05:38
    Bhawna Jain
    0

    Yes, BlogLandingPage has a field for nested content (having a document type with "Is an Element type" ticked).

    About the clash you mention, how can I refresh the content in IPublishedContent, only way I know is to clear nu cache from "Published Status" tab under settings under templating.

  • alimac 182 posts 371 karma points
    Mar 14, 2020 @ 00:14
    alimac
    0

    Just in case this helps anyone else, I was having the same problem with the error above.

    In my situation I was trying to create nodes programatically, but realised it was because I was creating a document type that had 'Is element type' selected as Marc suggested. Just switch that back off and it should work.

  • kate smith 2 posts 71 karma points
    Mar 14, 2020 @ 00:50
    kate smith
    0

    I can't reproduce this in the latest version of the codebase, so I'm going to assume it's been fixed already along the way! 9apps Vidmate

  • Jamie Attwood 201 posts 493 karma points c-trib
    Oct 04, 2022 @ 14:42
    Jamie Attwood
    0

    Not sure if this is a bug - I was having this issue with the latest issue of V10.1.1

    My issue was started when I changed a doc type with element "enabled" to "disabled".

    After playing with Memory Cache and Database Cache to no avail, I went back into the generated models and saw that all was ok there as far as IPublishContent was concerned, so I rebuilt and still nothing. Restarted the IIS app pool and bam - works.

    So, when this happens, make sure you regenerate your models, rebuild your source and then start the website process, should be good.

Please Sign in or register to post replies

Write your reply to:

Draft