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?
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, ERRORMESSAGE);
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
Right sorted i need after unpublish call
umbraco.library.UnPublishSingleNode(documentObject.Id);
works a treat.
is working on a reply...
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.