Copied to clipboard

Flag this post as spam?

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


  • Maciej 12 posts 73 karma points
    Feb 20, 2015 @ 17:28
    Maciej
    0

    System.StackOverflowException

    Hi All,

    I seem to be having problems with Ditto & Umbraco and Rich Text Editor internal links. It seems whenever there is a link to the homepage of the site, umbraco is getting into infite loop and throwing a StackOverflowException.

    Stack trace:

    I tried a few version of ditto. The above screenshot is from 0.4.1. In version 0.5.0 the same bug is killing the application pool.

    Just wondering if any of you experienced this problem?

    Many thanks,
    M

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Feb 20, 2015 @ 18:22
    Hendy Racher
    0

    Hi,

    Yes, we've enountered a similar situation and as a temporary fix, we removed the DittoPublishedContentModelFactory, and set a default controller (and subsequent hijack controllers) to use Ditto to create the models at that point. (There seems to be some sort of issue in Umbraco such that when using the model factory, models for all nodes in the path from the home to the desired node are all inflated).

    HTH,

    Hendy

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Feb 20, 2015 @ 21:45
    Lee Kelleher
    0

    Yup, there's a massive issue with Ditto and the ModelFactory implementation. :-( Currently I have no resolution for it, (I'm totally open to suggestions/contributions).

    Cheers,
    - Lee

  • Maciej 12 posts 73 karma points
    Feb 21, 2015 @ 12:13
    Maciej
    0

    I don't think it is an issue with Ditto at all. I did try at least one different mapper and the same exception was thrown. I did come up with a workaround in v 0.4.1, but it requires calling Umbraco.Web.Templates.TemplateUtilities.ParseInternalLink in your views. 

    Do you think it would be worth getting one of the Core devs involved in this topic?

    Cheers,
    Maciej 

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Feb 21, 2015 @ 15:10
    Lee Kelleher
    0

    Hi Maciej,

    I still think it is a Ditto problem, as all Umbraco core is doing is calling CreateModel which is then calling Ditto's ModelFactory to convert it. I'm not sure what else Umbraco core can do about it. I know that Stephan is looking into this.

    Have a read over these other topics, they hit the same issue with Ditto's ModelFactory too:

    https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/61167-IPublishedContentModelFactory-and-a-Contentpicker-PropertyValueConverter

    https://our.umbraco.org/projects/developer-tools/ditto/ditto-feedback/57167-BaseController-BaseViewModel-with-Hijacked-controllers

    Cheers,
    - Lee

  • Maciej 12 posts 73 karma points
    Mar 09, 2015 @ 15:57
    Maciej
    0

    Hi Lee,

    Thanks for all the comments. 

    What way would you recommend to get around this issue?

    Thanks, Maciej

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Mar 09, 2015 @ 16:18
    Lee Kelleher
    0

    Hi Maciej,

    In all honesty I would recommend not using the DittoPublishedContentModelFactory at all.

    If you do want to use the ModelFactory approach, then go with Zbu.ModelsBuilder.

    Cheers,
    - Lee

  • Stephen 767 posts 2273 karma points c-trib
    May 26, 2015 @ 18:51
    Stephen
    0

    @Lee: would love to understand what Ditto is doing that the factory does not like. Obviously, creating a Ditto model seems to be somewhat reentrant, ie it will create other models, and eventually ends up creating the original model again, which is something that the Factory indeed does not like at all. I'm wondering to which extent it is a corner-case, or whether it would be interesting to refactor the Factory to handle such situation in a better way (it can be done, just need to track the graph of created models and break when trying to create a model we're already creating).

    Another thing of interest to me: with the NuCache, which caches the IPublishedContent objects... if there's a Factory installed, then the cache would cache the models themselves, so that the creation of the model only happens once and not on every request. This has some consequences on models, ie they should be standalone things that should not contain references to other models (but only eg identifiers of other contents). From what I understand of the stack overflow issue... I'm wondering whether Ditto models would fit at all?

    Dunno if you're at the retreat? But would really love spending a couple of hours discussing "modeling at large" ;-)

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 27, 2015 @ 14:56
    Lee Kelleher
    0

    @Stephan - yes, let's talk at CG15, (and at the retreat too)! When I try to explain the issue/scenario I get confused with the explanation - so will be better to go through code examples together (and/or with others too).

    (I've deleted what I've written in this reply a couple of times already, as it's too confusing - haha)

    Cheers,
    - Lee

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 01, 2016 @ 10:54
    Jeroen Breuer
    0

    You can experiment with NuCache already. The source code is available here: https://github.com/umbraco/Umbraco-CMS/tree/dev-v7-contentcache

    In this video I explain how I've upgraded a project to NuCache: https://youtu.be/DWjbJiIUQdk?t=31m8s

    The project can be found here: https://our.umbraco.org/projects/developer-tools/1-1-multilingual-example/

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft