Copied to clipboard

Flag this post as spam?

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


  • Craig100 1136 posts 2523 karma points c-trib
    Jan 23, 2019 @ 20:04
    Craig100
    0

    Macro within macro stopped displaying in RTE after upgrade

    Umb 7.13.1 upgraded from 7.5.4

    Could someone please tell me what has changed between 7.5.4 and 7.13.1 to prevent the following macro from displaying in an RTE? Error is indicated in the code:-

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @using ContentModels = Umbraco.Web.PublishedContentModels;
    @{ 
        var assetId = Model.MacroParameters["asset"];
    
        dynamic asset = Umbraco.TypedContent(assetId);
    }
    @(RenderAsset(asset))
    
    @helper RenderAsset(ContentModels.MacroAccordion macroAccordion)
    {
        var accordions = macroAccordion.Accordion.Select(x => new ContentModels.Accordion(x));
        foreach (var accordion in accordions)
        {
            <div class="accordion">
                <header><h3>@(accordion.Title)</h3><span class="icon-icon-small-arrow-up"></span></header>
                <div class="accordion-content">
                    @(accordion.Content) <<<< Error : 'Cannot render a macro when there is no current PublishedContentRequest.'
                </div>
            </div>
        }
    }
    

    accordion.Content "can" contain another macro (not the same macro) and displays perfectly on the original site when it does.

    Any clues how to make this work again would be appreciated.

    Many thanks.

    Craig

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 23, 2019 @ 22:17
    Jan Skovgaard
    0

    Hi Craig

    I'm not quite sure what might be the cause of this but I'm wondering if you have consulted the version specific upgrade documentation to see if anything could be causing this? https://our.umbraco.com/documentation/Getting-Started/Setup/Upgrading/version-specific

    Quite a lot has changed under the hood with all the minor versions from 7.5 to 7.13 so I guess it can be a bit hard to pinpoint the exact issue - Does the log file review some additional details about this or is it just showing the same error?

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft