Today I’ll notify you about an issue I recently discovered when you delete the user property SPS-Local (Office location) in SharePoint 2010 which breaks then the My Profile page!
You have User profile service application provisioned and a running user profile import connection. The My Sites are setup and in use by your users.
1. Go to the my sites host location (i.e. http://ServerName/My ) and click "My Profile" in the top bar --> This will create a profile page if not existing yet
2. Go to [Application management -manage service applications - user profile service application - manage user properties]
3. in property section "Contact information", select "Office Location" and delete it.
Go back to the "My Profile" page, refresh and you'll get an error (in web.config the customErrors mode are set to “off” and callstack =”true”)
The property “Office location” (Name: SPS-Local) is a default property and is checked on rendering the My Profile page. If this property does not exist, the page will fail and throwing the error that the property is missing.
Unfortunately you cannot recreate this property because it is prevented by the code to create a property with the name beginning with “SPS-…”.
The only way to recreate a default property you accidentally deleted is:
a) you restore the profile databases from the last known good backup the property still exists in or
b) you recreate the complete User Profile service application because only on new creation of the profile databases, these properties will be created by the process.
Even that you can delete a property, it is not recommended to do so although you may not need it! As seen above, SharePoint does! So if you don't need or use a property (especially one of the default properties) just edit the property and uncheck the applicable options to make it invisible.
I know that you’ll maybe say now,
Question: well why does SharePoint allow the deletion of this property when it is required and checked by code?
Answer: we did not experienced this behavior yet and it was not tested before as we did not expected the deletion of a default property.
A request for fix was rejected recently but we reported this misbehavior to the Product team internally to make them aware of.
A fix is not available and therefore this behavior is "by design" but it is considered maybe to build a fix, included soonest into SP2.
Stay tuned for latest news!