Error Setting the Regional Settings for a User Profile

EDIT: This issue is resolved in the May 2016 CU.

A SharePoint Administrator or user will receive an error setting the Regional Settings for a User Profile in the SharePoint 2013 February 2016 Cumulative Update. The error is specifically with the “Set Your Calendar” value.

RegionalSettings

When either the user changes to “Always use my personal settings”, as shown above, or the Administrator performs the same operation via the User Profile Service Application, SharePoint will generate an error due to an enumeration validation on the calendar type (SPCalendarType). The February 2016 Cumulative Update, or more specifically, KB3114719, includes this brand new validation method for the calendar type:

The issue is that the validation is performed using a C# short (aka Int16), which is the type the variable “value” is (as well as “num”). The SPCalendarType enum is an int (aka Int32); without a cast, this prevents the validation from succeeding, regardless of the value passed to it as Enum.IsDefined requires the object and enum target to be the same type. We can see this in the ULS logs.

Whoops. This would be resolved by changing the line  System.Enum.IsDefined(typeof(SPCalendarType), (short) num) to  System.Enum.IsDefined(typeof(SPCalendarType), (int) num). Simple fix. Unfortunately there is no work around at the moment as all methods pass through this validation (e.g. from PowerShell, SSOM, etc.).

A Microsoft PSS case has been opened.

4 Comments

  1. Hello, I’m having the same problem before and it took me a week to find the solution for the problem. Good thing you created a blog about this because many users are finding a solution same to us.

  2. This issue was indeed resolved in May 2016 CU. Just tested in a test farm

  3. Pingback: SharePoint 2013 Build Numbers and CU’s – Steve Chen [MSFT] Fast Track Esc. Engineer

  4. Funny thing this still occurs on July 2016 CU of SP2013. Just tested and getting this exact error when doing exact same procedure.

Leave a Reply