x First time here? Check out the FAQ
Join us a the Umbraco event of the year - get your Codegarden 14 early bird ticket today
  • Avatar27posts72karma

    No user exists with ID -1

    Dave Forster started this topic August 1, 2012 @ 09:44

    Got the YSOD ("No user exists with ID -1") when trying to publish via the Notifications Dashboard and judging by the release date of the package and lack of activity on here I figured the developer has washed his hands of it!

    So, my fix (to get it to work on Umbraco 4.7.2) was to download the source.. update the project references, change the target framework to .net 4 and update a couple of lines of code in UmbracoHelper.cs

    internal static void PublishItem(int id, string userId)
    {
        Document document = new Document(id);
        int uid;
        if (int.TryParse(userId, out uid))
        {
            User user = User.GetUser(uid);
            document.Publish(user);
            library.UpdateDocumentCache(document.Id);
        }
    }

    Compile and dump into your bin folder. 

    Hope this helps other who hit the same issue.


Please login or Sign up To post replies