Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Feb 13, 2009 @ 11:43
    Ismail Mayat
    0

    Action handler issue

    Guys,

    I have the following action handler code in umbraco v4.

    [code]

    public bool Execute(Document documentObject, IAction action)
    {

    if(ignoreAliases.Contains(documentObject.ContentType.Alias)){

    if (documentObject.HttpContext.CurrentHandler is BasePage)
    {
    documentObject.UnPublish();

    ((BasePage)documentObject.HttpContext.CurrentHandler).speechBubble(BasePage.speechBubbleIcon.error, "Message", ERRORMESSAGE);
    }
    Log.Add(LogTypes.Error, documentObject.Id, ERROR
    MESSAGE);
    return false;
    }

    return true;
    }

    public IAction[] ReturnActions()
    {
    return new IAction[] {
    ActionPublish.Instance
    };
    }


    [/code]

    Basically I have a couple of nodetypes that i do wont the user to publish. So the action handler on publish checks if doc being published is in exclude list if it is then user gets error speech bubble and i unpublsh the document. In umbraco itself the document is show as not being published however it is published becuase you can see it in the site. Am I missing a call maybe remove from xml cache or something?

    Regards

    Ismail

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Feb 13, 2009 @ 11:52
    Ismail Mayat
    0

    Right sorted i need after unpublish call

    umbraco.library.UnPublishSingleNode(documentObject.Id);

    works a treat.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies