Copied to clipboard

Flag this post as spam?

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


  • Nicolae Sebastian Laslo 12 posts 78 karma points
    Aug 28, 2009 @ 10:24
    Nicolae Sebastian Laslo
    0

    Fail to unpublish a node

    Hello guys,

     

    I'm trying to unpulish an item but doesn't work. Have you encounter this problem before ?

    Here is my code:

     

     foreach (Document _docWalker in arlPhotoNodes)
                {
                    ....................
                        _docWalker.UnPublish();
                        _docWalker.delete();
                   ...........................
                }

     

    Thanks in advanced

    Nicu

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 28, 2009 @ 10:48
    Peter Dijksterhuis
    100

    Hi,

    I think you need to make a call (after the unpublish) to : 

    umbraco.library.UpdateDocumentCache(_docWalker.Id);
    HTH,
    Peter
  • Nicolae Sebastian Laslo 12 posts 78 karma points
    Aug 28, 2009 @ 10:49
    Nicolae Sebastian Laslo
    0

    I have just discoverd that you have to delete it from config file as well like that

    umbraco.library.UnPublishSingleNode(_docWalker.Id);

     

    seems that

     _docWalker.UnPublish();

    only mark document as unpublish
  • Nicolae Sebastian Laslo 12 posts 78 karma points
    Aug 28, 2009 @ 10:50
    Nicolae Sebastian Laslo
    0

    Hi Peter,

     

    You solution is correct

     

    thanks

    nicu

Please Sign in or register to post replies

Write your reply to:

Draft