From 57985cd0b2989c31d99ece2fa2531d6edf8f2e55 Mon Sep 17 00:00:00 2001 From: agrath Date: Tue, 28 Feb 2012 10:39:02 -1300 Subject: [PATCH] Publish notification/workflow fails when using Distributed Calls, performedUser is null - check for null and replace with admin user --- umbraco/cms/Actions/Action.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/umbraco/cms/Actions/Action.cs b/umbraco/cms/Actions/Action.cs index 9c483705f8..6f38cc4988 100644 --- a/umbraco/cms/Actions/Action.cs +++ b/umbraco/cms/Actions/Action.cs @@ -27,7 +27,7 @@ namespace umbraco.BusinessLogic.Actions /// public class Action { - private static List _actions = new List(); + private static List _actions = new List(); private static List _actionHandlers = new List(); private static readonly List _actionJSReference = new List(); @@ -52,7 +52,7 @@ namespace umbraco.BusinessLogic.Actions _actions.Clear(); _actionHandlers.Clear(); RegisterIActions(); - RegisterIActionHandlers(); + RegisterIActionHandlers(); } } @@ -147,6 +147,14 @@ namespace umbraco.BusinessLogic.Actions { u = User.GetUser(0); } + if (u == null) + { + //GE 2012-02-29 + //user will be null when using distributed calls + //can't easily get the real publishing user to bubble all the way through the distributed call framework + //so just check for it and set it to admin, so at least the notification gets sent + u = User.GetUser(0); + } Notification.GetNotifications(d, u, action); }