Edit Mode User Menus broken after upgrade from 8.11 to 10.10

Vote:
 

Hi,

We recently upgraded from 8.11 to 10.10 but the menus (and gadgets) either don't display or display incorrectly after the upgrade.

I found discussion on the forum about this and how reseting the views fixed the issue but was wondering if there was a reliable automated way to fix this for all editors.

Thanks,

#185587
Edited, Nov 27, 2017 7:18
Vote:
 

Hi,

I based the following on the post here, it should reset the views for all users:

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="EPiServer.ServiceLocation" %>
<%@ Import Namespace="EPiServer.Security" %>
<%@ Import Namespace="EPiServer.Shell.Security" %>
<%@ Import Namespace="EPiServer.Shell.ViewComposition" %>

<%
    var userProvider = ServiceLocator.Current.GetInstance<UIUserProvider>();
    var repository = ServiceLocator.Current.GetInstance<IPersonalizedViewSettingsRepository>();
    var userImpersonation = ServiceLocator.Current.GetInstance<IUserImpersonation>();
    int totalRecords;

    foreach (var user in userProvider.GetAllUsers(0, 1000, out totalRecords))
    {
        var principal = userImpersonation.CreatePrincipal(user.Username);
        var settings = repository.Load(principal);

        foreach (var setting in settings)
        {
            repository.Delete(principal, setting.ViewName);
            Response.Write(string.Format("View {0} reset for user: {1}", setting.ViewName, user.Username));
        }

    }
    
%>

Reliability is another matter laughing, but seemed to work in a single test I did!

#185693
Edited, Nov 30, 2017 1:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.