Unpublish action handler issue Options
imayat12
Posted: Monday, March 03, 2008 5:39:07 PM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
Guys,

I have had a dig through codeplex and issue has not been reported so not sure if its just me. I have following test code:

Code:


using System;

namespace Test
{
    /// <summary>
    /// Summary description for SearchUpdateActionHandler.
    /// </summary>
    public class TestActionHandler : umbraco.BusinessLogic.Actions.IActionHandler
    {
        public TestActionHandler()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        #region IActionHandler Members

        public string HandlerName()
        {
            return "TestUpdate";
        }

        public bool Execute(umbraco.cms.businesslogic.web.Document documentObject, umbraco.interfaces.IAction action)
        {
            if (action.Alias == new umbraco.BusinessLogic.Actions.ActionDelete().Alias || action.Alias == new umbraco.BusinessLogic.Actions.ActionUnPublish().Alias)
            {
             
                umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.System, new umbraco.BusinessLogic.User(0), documentObject.Id, "Test delete or unpublish");
            }
            else
            {
             
                umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.System, new umbraco.BusinessLogic.User(0), documentObject.Id, "Test add");
            }
            return true;
        }

        public umbraco.interfaces.IAction[] ReturnActions()
        {
            // TODO:  Add SearchUpdateActionHandler.ReturnActions implementation
            umbraco.interfaces.IAction[] _retVal = { new umbraco.BusinessLogic.Actions.ActionPublish(), new umbraco.BusinessLogic.Actions.ActionUnPublish(), new umbraco.BusinessLogic.Actions.ActionMove(), new umbraco.BusinessLogic.Actions.ActionDelete() };
            return _retVal;
        }

        #endregion
    }
}


All events fire except unpublish. Has anyone else come across this issue? I am using umbraco v3.0.2

I noticed the issue when the unpublish was not firing in umbraco search indexing. If anyone else can re create then i will create item in codeplex.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
imayat12
Posted: Monday, March 03, 2008 5:49:18 PM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
A bit more information. I added another debug statement just to say which action it was handling and in both publish and unpublish it is stating that the publish event is being handled. Also I think this issue in codeplex is the same

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
imayat12
Posted: Tuesday, March 04, 2008 4:11:15 PM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
Guys,

Found the issue and have submitted patch to codeplex see patch id 917.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.