+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / IE 9 Bug? -- User information null in MediaContentDownloadedEvent

IE 9 Bug? -- User information null in MediaContentDownloadedEvent

1 posts, 0 answered
  1. Rico
    Rico avatar
    88 posts
    Registered:
    30 Aug 2012
    05 Mar 2013
    Link to this post

    Hi there,

    I have what seems to be a browser bug. I'm subscribing to the IMediaContentDownloadedEvent in order to track users opening documents. Everything works fine in Google Chrome, FF, Safari. However, when using IE 9 -- the code fires, however the User information is always null. How is it that this is happening? The 'user' variable below is null -- and the 'eventInfo.UserId' is an empty Guid. I'd appreciate any help with this...

    //class that handles the event

    public static void MediaContentDownloadedEvent(IMediaContentDownloadedEvent eventInfo)
    {
    var userId = eventInfo.UserId; //Guid

    User user = GetCurrentSitefinityUser();
    ...

    }

    ...

    // utilities class to get the current user

    public static User GetCurrentSitefinityUser()
    {
    var identity = ClaimsManager.GetCurrentIdentity();
    var currentUserGuid = identity.UserId;

    if (currentUserGuid != Guid.Empty)
    {
    UserProfileManager profileManager = UserProfileManager.GetManager();
    UserManager userManager = UserManager.GetManager("Default");
    return userManager.GetUser(currentUserGuid);
    }
    else
    {
    return null;
    }
    }

    ..

    private void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
    {
    if (e.CommandName == "Bootstrapped")
    {EventHub.Subscribe<IMediaContentDownloadedEvent>(evt => CRD.Sitefinity.CustomDecorator.BusinessOpportunitiesDecorator.MediaContentDownloadedEvent(evt));
    }}

1 posts, 0 answered