Copied to clipboard

Flag this post as spam?

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

  • Jannik Anker 48 posts 258 karma points c-trib
    Apr 29, 2014 @ 11:10
    Jannik Anker

    UmbracoHelper.RenderTemplate infinite loop in 4.11.10

    Hey there,

    I've upgraded a 4.7.2 webforms solution to 4.11.10 (still webforms), and everything but the front page is working fine... After experiencing and reading about this bug: I changed my code to use UmbracoHelper.RenderTemplate instead of umbraco.library.RenderTemplate - but to no avail???

    The front page crashes the w3wp.exe just as described in the issue report. Debugging goes fine until I hit a RenderTemplate usage, in which case it just starts over - and it only happens on the front page, so I'm pretty sure this is the same issue.

    Here's a bit of example code (not pretty, and you can tell I've been debugging and trying things like crazy):

    <% foreach (var nodeId in CurrentSubContent.WidgetsLeft)
    Node x = new Node(nodeId);
    if (x.Id != 0 && x.Id != CurrentSubContent.Id) { %>
    <%= Helper.RenderTemplate(x.Id).ToHtmlString() %>
    <% }
    } %>

    Could this bug have been reintroduced in later 4.11 versions? We're using lots of uSiteBuilder functionality, so any further upgrades are not in the pipeline (maybe until uSiteBuilder supports v6/v7).

  • Jannik Anker 48 posts 258 karma points c-trib
    May 05, 2014 @ 13:34
    Jannik Anker

    Bump :-s

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 16:59
    Charles Afford

    This does kind of make sense

    Can you tell us the type of 'CurrentSubContent.WidgetsLeft'.

    It seems that it is a collection but you are using == CurrentSubContent.Id

    This feels at first glance to be a code problem rather than a bug. Could be wrong :)


  • Jannik Anker 48 posts 258 karma points c-trib
    May 06, 2014 @ 15:49
    Jannik Anker

    Well, I don't think it makes sense :-) The code works fine in 4.7.2.

    CurrentSubContent is basically the current node (wrapped in an object that inherits from the uSiteBuilder TemplateBase).

    WidgetsLeft returns a list of node id's ( List<NodeId> ), where NodeId is just a custom struct.

    My comparison of id's happens after I've created a new Node object (x), which makes the comparison valid, the way I see it. The latter comparison with CurrentSubContent.Id is only there because of my debugging efforts (because naturally, rendering the template you're already rendering would create an infinite loop).

  • Jannik Anker 48 posts 258 karma points c-trib
    May 21, 2014 @ 14:05
    Jannik Anker

    Turns out I'm the schmuck anyways. I mysteriously overlooked one (ONE!) usage of the old TemplateHandler.RenderTemplate method, which happened to be used only on the front page.

    Joke's on me, then.

Please Sign in or register to post replies

Write your reply to: