Publish notification/workflow fails when using Distributed Calls, performedUser is null - check for null and replace with admin user

This commit is contained in:
agrath
2012-02-28 10:39:02 -13:00
parent 7b6c711239
commit 57985cd0b2

View File

@@ -27,7 +27,7 @@ namespace umbraco.BusinessLogic.Actions
/// </summary>
public class Action
{
private static List<IAction> _actions = new List<IAction>();
private static List<IAction> _actions = new List<IAction>();
private static List<IActionHandler> _actionHandlers = new List<IActionHandler>();
private static readonly List<string> _actionJSReference = new List<string>();
@@ -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);
}