Copied to clipboard

Flag this post as spam?

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

  • Yasir Butt 161 posts 371 karma points
    Jun 29, 2016 @ 10:45
    Yasir Butt

    DataTokens must contain an 'umbraco-doc-request' key with a PublishedContentRequest object


    We have updated our project from 7.2.8 to 7.4.3 recently. we are getting error on out custom routes controller and error is

    DataTokens must contain an 'umbraco-doc-request' key with a PublishedContentRequest object

    My custom contorller is inherited to RenderMvcController. Getting error on var profile = Umbraco.TypedContent(memberId)

    it looks like umbraco context is not valid here anymore while same code was working in earlier version.

    is it bug in Umbraco or new change?

    can some one help me?

    Just info! for time being i have changed the code like

    var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
            var profile = umbracoHelper.TypedContent(memberId);

    and its worked. but i dont want to do it in my whole project because there are too many custom controllers.


  • Murray Roke 503 posts 966 karma points c-trib
    Aug 15, 2023 @ 23:12
    Murray Roke

    Not exactly on topic, but for anyone searching, I had the same error after upgrading from v7 to v8, and the code in my RenderMVController was updated to:

    var contents = UmbracoContext.Content.GetAtRoot();

    but should have been updated to:

    var contents = Current.UmbracoContext.Content.GetAtRoot();
Please Sign in or register to post replies

Write your reply to: