I need to display a warning message to the author before they publish. With the code below, I get the following exception:
Object Reference not set to the instance of an object exception. Sitecore.Context.ClientPage.ClientResponse is null.
How can I fix this? Or is there a different way to do this?
public class PublishPipeline :
Sitecore.Publishing.Pipelines.PublishItem.PerformAction
{
public override void Process(PublishItemContext context)
{
Sitecore.Context.ClientPage.ClientResponse.Alert("This will publish to the production site!");
base.Process(context);
}
}
<processor type="MyProject.PublishPipeline, MyAssembly" />