Copied to clipboard

Flag this post as spam?

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


  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Jun 03, 2013 @ 03:55
    Peter Gregory
    0

    ContentService Move method does not fully update the Cache.

    Before I went and logged a bug over at issues I wanted to see if anyone else was experiencing this issue or if it was just me?

    I have a site with the following structure. (simplified for brevity sake)

    Home
    -Tenders
    --Tender1
    --Tender2
    Tender Archive

    I have created a UserControlWrapper datatype which is a simple button that allows content editors to quickly archive tenders to the tender archive Node.

    The guts of the code that I am using to do this is

    var cs = new ContentService();
    var page = cs.GetById(Int32.Parse(HttpContext.Current.Request["id"]));
    cs.Move(page, ConfigHelper.GetArchiveRootAsNode().Id);
    cs.SaveAndPublish(page);

    This all works well in the back office, the node is moved and its Path details etc seem correct in the Cache file (umbraco.config) however, in the cache the page is still positioned as a child of Tenders.

    If I use the standard backoffice right click move the document is moved correctly to the archive and the Cache is updated as expected.

    There are no events that are doing anything else.  Does anyone have any ideas what could be going on? or is this a v6 bug?

     

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Jun 03, 2013 @ 13:57
    Peter Gregory
    100

    It has been identified as a bug.  The work around is to use library.RefreshContent(); after the move to refresh the content cache and put the node where it should be.  For infromation about the bug see http://issues.umbraco.org/issue/U4-2312

Please Sign in or register to post replies

Write your reply to:

Draft