Wednesday, October 17, 2012

Why I Hate SharePoint #3

There are a lot of people out there that love SharePoint. I know they exist because I've met a couple, and coward as I am, kept my mouth shut. To be honest, if you use SharePoint exactly as it was intended, it is probably OK.
Maybe I'm trying to do something really exceptional here but it doesn't feel that way. So to continue the theme, here are a few more "exceptional" things.


#1. I've added a Wiki library to a site and to the wiki home page I add a list web part of the wiki pages, using the default view "All Pages". I then generaet a site template, create a new site from this template, but then any attempt to access the wiki home page or the wiki (since the default action for the wiki is to show the home page) falls over with a correlation ID error, in this case an InvalidOperationException at SPListItem.get_EffectiveBasePermissions().

But if I go back to the original site, create a custom view explicitly based on the "All Pages" view, change the web part on the home page to use that view, and then generate the site template again, then now I can create sites that don't have this issue.


#2. Take the SPGroupCollection.Add( name, owner, defaultUser, description) method which allows you to create a SharePoint group and add it to a site. What sort of error do you expect to get if say the specified owner does not exist. Something like "owner is unrecognised". Well what I got was an error that basically said something like "one of the parameters was not in the accepted range". Most of the .Net framework actually provides really good exception messages. To me such a generic message is usually indicative of either rushed code or lack of caring. It certainly isn't helpful to someone who is trying to work out why a piece of PowerShell has suddenly stopped working.


Incidently PowerShell has been one of the positives from the SharePoint project I'm on. While it seems to have an almost accidental syntax to it, there are also a lot of interesting features. I'll save my views on PowerShell though for a different post.





No comments:

Post a Comment