If you would like to discuss anything, please contact me via email: Howard.Bayliss@sequence.co.uk

Monday, October 24, 2011

SharePoint SummaryLinks "Edit Properties"

While logged-in as a user with Contributor permissions, I noticed that the toolbar for a Summary Links field was not visible on the Edit Form of a publishing page.

This is is shown in the picture below:

SummaryLinks has no

I suspect this is a SharePoint bug as the toolbar was visible when the page was in WYSIWYG edit mode.

Also, the issue did not occur when logged-in as a Site Collection administrator.

A work-around to this issue is to give the user the Manage Lists permission. However, this is really not something you should consider lightly as it gives editors an awful lot of power.

I'm going to speak to Microsoft to see what they say about it and then I'll post an update....

UPDATE


Microsoft has acknowledged that this is an "Offbug" (as they call it). In other words, it's a bug in their code.


This will be fixed in a future hotfix or service pack. However, they will not / cannot give a date for the fix.

Tuesday, September 13, 2011

SharePoint Inline HTML Editor

One of our clients had very specific requirements for the way in which their editors manage the main body content of a page. Here is some background:

With the previous version of SharePoint (MOSS 2007), page editors could edit page content using a Rich Text editor that sat above the content field. This is shown below:

MOSS RichText Editor

With SharePoint 2010, the Ribbon provides the editing functionality, as shown below:

Ribbon Editor

Even though our client is using SharePoint 2010, they wanted to use the MOSS-style page editor, rather than the Ribbon. This was for a subset of editors, on one specific site.

One way to solve this is to switch the User Interface (UI) version of the site from "4", to "3" e.g. switch from the SharePoint 2010 UI to the MOSS UI. This is done via the SPWeb.UIVersion property.

We didn't want to change the UI version so in the end, the solution was to:

1) Create a custom edit form.
2) Change the control used to edit the page content from SharePoint:FormField to SharePoint:InputFormTextBox

The InputFormTextBox has some properties that allow Rich Text, which are shown below:

<SharePoint:InputFormTextBox TextMode="MultiLine" Rows="6" RichText="true" RichTextMode="Compatible" runat="server" />

Friday, September 9, 2011

SharePoint 0x810200c6 List Validation Failed

We use custom code to create a new Publishing Page:

SPWeb currentWeb = SPContext.Current.Web;

PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(currentWeb);

PublishingPage page = publishingWeb.GetPublishingPages().Add(newPageName, newPageLayout);

This was failing with the error:

<nativehr>0x810200c6</nativehr><nativestack></nativestack>List data validation failed.

The error was caused because the Pages library had validation applied to it, which validated two date fields. The formula for the validation was:

=[Start Date and Time]<[End Date and Time]

When the page was created in code, the validation was fired, which failed because the two date fields are initially empty.

The solution to the problem was to change the validation formula to handle the initial values e.g.

=[Start Date and Time]<=[End Date and Time]

Tuesday, September 6, 2011

SharePoint The document contains invalid utf-8 encoded characters

We used SharePoint to index a website and got the message "The document contains invalid utf-8 encoded characters".

To fix this, modify the target site and replace special characters with their encoded equivalent. For example, replace any £ characters with &pound;. The same is true for ©, which should be replaced with &copy, etc.

Use the W3C validator to identify encoding issues.

Tuesday, July 5, 2011

"Activate Features" "The object has been updated by another user since it was last fetched"

I created a Feature Receiver to assign an Event Receiver to various content types. This was working fine. However, after a small update to the code, the package would no longer deploy and failed with the following message:

Error occurred in deployment step 'Activate Features': The object has been updated by another user since it was last fetched.

I discovered the problem was caused because I:



  1. Assigned the Event Receiver to a base content type (CT 1).


  2. Immediately after attempted to add the Event Receiver to a content type (CT 2) derived from the base content type (CT 1)

To solve the issue, I did not do step (1) above and just did step (2).

Wednesday, June 29, 2011

SharePoint Public Websites

This is how you can find a list of public web sites built using SharePoint...

To do this, I used Google to search for the phrase "Turn on more accessible mode". This phrase is rendered by most SharePoint pages yet is specific enough to restrict the number of non-SharePoint sites returned.

Try it for yourself: http://www.google.co.uk/search?q=%22Turn+on+more+accessible+mode%22

I'm aware of the list on WssDemo.com. However, I wanted to use Google to generate a dynamic list.

Monday, June 27, 2011

SharePoint "Corrupted Control Template"

I began seeing the error message "Corrupted Control Template" when I switched a Publishing Page into Edit Mode.

Eventually I tracked-down the issue....

1) Another developer had created a number of custom fields.
2) They had created a file called "fldtypes_custom.xml" (which is required to register the custom field types).
3) I renamed this file to something more specific.

To fix the issue I had to....

1) Delete the Web Application (including the associated Content Database)
2) Rename the file back to what it was before I changed it
3) Re-deploy the solution.