Copied to clipboard

Flag this post as spam?

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


  • mikkelstrack 26 posts 31 karma points
    Feb 02, 2010 @ 12:12
    mikkelstrack
    0

    Action handlers in Umbraco 3

    Hi,

    Im doing some stuff with action handlers in an old installation (Umbraco 3), and I have a minor problem.

    Some of the code look like this

            Boolean umbraco.BusinessLogic.Actions.IActionHandler.Execute(umbraco.cms.businesslogic.web.Document documentObject, umbraco.interfaces.IAction action)
            {
                if (documentObject.ContentType.Alias == "blogComment" && action.Alias == "create")
                {
                    try
                    {
                        Document doc = new Document(documentObject.Parent.Id);

                        GetMemberList(doc.getProperty("guid").Value.ToString(), documentObject.getProperty("authorEmail").Value.ToString());
                        documentObject.Save();
                    }
                    catch (Exception)
                    {
                        return false;
                    }
                    return true;
                }
                else
                {
                    return false;
                }
            }

    I need to get the value in bold, but it's empty - I guess it's because the handler fires "too early". Is there something I can do...like using an action that fires after publish? Or any other way I can get this value.

     

    /Mikkel

  • mikkelstrack 26 posts 31 karma points
    Feb 02, 2010 @ 12:25
    mikkelstrack
    0

    Okay...Im just blind

    I changed:
    return new umbraco.interfaces.IAction[] { new umbraco.BusinessLogic.Actions.ActionNew()};

    To:
    return new umbraco.interfaces.IAction[] { new umbraco.BusinessLogic.Actions.ActionPublish()};

     

     

  • 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