Copied to clipboard

Flag this post as spam?

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


  • Alex Skrypnyk 5772 posts 21984 karma points MVP 4x admin c-trib
    May 25, 2020 @ 18:52
    Alex Skrypnyk
    0

    SQL - restore nodes from the recycle bin for Umbraco 4

    SQL help needed can somebody help with the query that would restore nodes from the recycle bin for Umbraco 4 ? :slightlysmilingface:

  • Alex Skrypnyk 5772 posts 21984 karma points MVP 4x admin c-trib
    May 28, 2020 @ 22:35
    Alex Skrypnyk
    0

    This task makes me crazy :)

  • Alex Skrypnyk 5772 posts 21984 karma points MVP 4x admin c-trib
    May 28, 2020 @ 23:49
    Alex Skrypnyk
    0

    This code saves nodes, but how to restore from the bin? Umbraco 4.7.2

    var bin = new RecycleBin(RecycleBin.RecycleBinType.Content);
    var totalTrashedItems = bin.GetDescendants().Cast<dynamic>();
    
    foreach (var totalTrashedItem in totalTrashedItems)
    {
        var doc = new Document(totalTrashedItem.Id);
        if (doc.IsTrashed)
        {
            //doc.PublishWithChildrenWithResult();
            doc.Save();
            doc.PublishWithResult(new User(0));
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft