<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>entwicklungsgedanken &#187; bug</title>
	<atom:link href="http://www.entwicklungsgedanken.de/tag/bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.entwicklungsgedanken.de</link>
	<description>Verschiedene Gedanken rund um die Softwareentwicklung</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:09:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Updating existing lookup fields in SharePoint</title>
		<link>http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 11:39:50 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[lookup]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[SchemaXml]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/</guid>
		<description><![CDATA[Creating lookup-fields only via XML-Definition is not possible. You need the ID of the Web hosting the list and the ID of the list hosting the data the lookup field is connected to. This information can only be retrieved when both entities are created… Object model?! When looking into the SPFieldLookup-class you find the properties [...]]]></description>
			<content:encoded><![CDATA[<p>Creating lookup-fields only via XML-Definition is not possible. You need the ID of the Web hosting the list and the ID of the list hosting the data the lookup field is connected to. This information can only be retrieved when both entities are created…</p>
<h3>Object model?!</h3>
<p>When looking into the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldlookup.aspx">SPFieldLookup</a>-class you find the properties LookupField, LookupList and LookupWebId. LookupWebId and LookupField can easily be set via the object model. The documentation says that <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldlookup.lookuplist.aspx">LookupList is read and writeable</a> which is not true. Setting LookupList throws an exception stating out “Cannot change the lookup list of the lookup field.”.</p>
<h3>SchemaXml and Regex to the rescue</h3>
<p>The <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.schemaxml.aspx">SchemaXml-property</a> of a SPField can be used to manipulate the LookupList. One stumbling block is that you do not know the Guid of the LookupList currently stored in the schema. Even if you define a Guid inside your xml-field-definition SharePoint puts in an other Guid. Here a simple regular expression comes to help.</p>
<p><strong>The code for connecting a site-column with a list somewhere in some web:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Declarations (myWeb is the context given by a feature receiver scoped &quot;web&quot;)</span>
var rx <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Regex<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;List=<span style="color: #008080; font-weight: bold;">\&quot;</span>([^<span style="color: #008080; font-weight: bold;">\&quot;</span>]*)<span style="color: #008080; font-weight: bold;">\&quot;</span>&quot;</span>, RegexOptions.<span style="color: #0000FF;">IgnoreCase</span> <span style="color: #008000;">|</span> RegexOptions.<span style="color: #0000FF;">ECMAScript</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
var root <span style="color: #008000;">=</span> myWeb.<span style="color: #0000FF;">Site</span>.<span style="color: #0000FF;">RootWeb</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// myListInstance is an instance of a SPList existing somewhere</span>
var lookupField <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>SPFieldLookup<span style="color: #000000;">&#41;</span>root.<span style="color: #0000FF;">Fields</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;MyLookupField&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
var xml <span style="color: #008000;">=</span> lookupField.<span style="color: #0000FF;">SchemaXml</span><span style="color: #008000;">;</span>
xml <span style="color: #008000;">=</span> rx.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span>xml, <span style="color: #FF0000;">String</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;List=<span style="color: #008080; font-weight: bold;">\&quot;</span>{0}<span style="color: #008080; font-weight: bold;">\&quot;</span>&quot;</span>, myListInstance.<span style="color: #0000FF;">ID</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;B&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
lookupField.<span style="color: #0000FF;">SchemaXml</span> <span style="color: #008000;">=</span> xml<span style="color: #008000;">;</span>
<span style="color: #008080; font-style: italic;">// Do not call update here!</span>
<span style="color: #008080; font-style: italic;">// Quote from MSDN &quot;Do not call the Update method when using the SchemaXml  property to modify a field.&quot;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Fetch the field again and apply the web-id</span>
var lookupFieldReFetch <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>SPFieldLookup<span style="color: #000000;">&#41;</span>root.<span style="color: #0000FF;">Fields</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;MyLookupField&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
lookupFieldReFetch.<span style="color: #0000FF;">LookupWebId</span> <span style="color: #008000;">=</span> myWeb.<span style="color: #0000FF;">ID</span><span style="color: #008000;">;</span>
lookupFieldReFetch.<span style="color: #0000FF;">LookupField</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Title&quot;</span><span style="color: #008000;">;</span>
lookupFieldReFetch.<span style="color: #0000FF;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>This problem still persists in the beta of SharePoint 2010. I hope this will get fixed in the RTM. <a href="http://pholpar.wordpress.com/2010/01/26/updating-sharepoint-lookup-and-user-field-values/">Creating a lookup-field-connection</a> is far more easy by the way …</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>With great power comes &#8211; PublishingWeb.DefaultPage</title>
		<link>http://www.entwicklungsgedanken.de/2009/10/30/with-great-power-comes-publishingweb-defaultpage/</link>
		<comments>http://www.entwicklungsgedanken.de/2009/10/30/with-great-power-comes-publishingweb-defaultpage/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 10:28:00 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[publishing]]></category>
		<category><![CDATA[RunWithElevatedPrivileges]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2009/10/30/with-great-power-comes-publishingweb-defaultpage/</guid>
		<description><![CDATA[or at least the power of “Use Remote Interfaces &#8211; Use SOAP, Web DAV, or SharePoint Designer interfaces to access the Web site”. In a SharePoint project I’m working on it was necessary to get the default page of a publishing web in case where it differs from default.aspx. &#160; In the environment the project [...]]]></description>
			<content:encoded><![CDATA[<p>or at least the power of “<strong>Use Remote Interfaces &#8211; Use SOAP, Web DAV, or SharePoint Designer interfaces to access the Web site</strong>”.</p>
<p>In a SharePoint project I’m working on it was necessary to get the default page of a publishing web in case where it differs from <code>default.aspx</code>.    <br />&#160; <br />In the environment the project takes place the “normal SharePoint user” is not allowed to use the SharePoint Designer. The page itself can be fully viewed by these users but the following code throws a <code>SecurityException</code> due to the missing “Remote interface”-permission.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// ... web is instantiated and disposed of course!</span>
var pub <span style="color: #008000;">=</span> PublishingWeb.<span style="color: #0000FF;">GetPublishingWeb</span><span style="color: #000000;">&#40;</span>web<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
var defaultPage <span style="color: #008000;">=</span> pub.<span style="color: #0000FF;">DefaultPage</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// ....</span></pre></div></div>

<p>In order to work in my projects environment this peace of code needs to be wrapped inside a resource-expensive <code>SPSecurity.RunWithElevatedPrivileges</code>-delegate. Makes absolutely no sense to me&#8230;</p>
<p>SharePoint 2010 has a lot of improvements for the “publishing infrastructure”. Lets hope this is fixed, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2009/10/30/with-great-power-comes-publishingweb-defaultpage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do not use DateTimeField when displaying the date of your field</title>
		<link>http://www.entwicklungsgedanken.de/2009/08/21/do-not-use-datetimefield-when-displaying-the-date-of-your-field/</link>
		<comments>http://www.entwicklungsgedanken.de/2009/08/21/do-not-use-datetimefield-when-displaying-the-date-of-your-field/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 08:54:34 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[DateTime]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=326</guid>
		<description><![CDATA[I have a &#8220;DateTime-field&#8221; inside a list which contains both date and time. In order to allow the user to edit this information inside the publishing page I used the Microsoft.SharePoint.WebControls.DateTimeField. If you only want to display that field-value you can simply use the ControlMode-property and set it to Display. If you want to display [...]]]></description>
			<content:encoded><![CDATA[<p>I have a &#8220;DateTime-field&#8221; inside a list which contains both date and time. In order to allow the user to edit this information inside the publishing page I used the <code>Microsoft.SharePoint.WebControls.DateTimeField</code>.</p>
<p>If you only want to display that field-value you can simply use the <code>ControlMode-property</code> and set it to <code>Display</code>. If you want to display only the date-part of that datetime just set the <code>DateOnly-property</code> to <code>true</code>&#8230;</p>
<p>Thats the theory. If you do it like that you get a nice <code>Object reference not set to an instance of an object</code>-error. The cause is</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">DateTimeField.<span style="color: #0000FF;">set_DateOnly</span></pre></div></div>

<p>Reflectoring the control reveals that when the control is in &#8220;DisplayMode&#8221; the inner <code>DateTimeControl</code> is not created and that is why <code>DateOnly</code> cannot be set.</p>
<p>Its seems this control was developed by a drunken programmer as <a href="http://www.coeamyd.net/PermaLink,guid,561b2b93-bfa5-4ad7-9805-d939b2b9301e.aspx">my friend stated out a bug in this control</a> a while ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2009/08/21/do-not-use-datetimefield-when-displaying-the-date-of-your-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site-Definitions within SharePoint are useless!</title>
		<link>http://www.entwicklungsgedanken.de/2009/04/19/site-definitions-within-sharepoint-are-useless/</link>
		<comments>http://www.entwicklungsgedanken.de/2009/04/19/site-definitions-within-sharepoint-are-useless/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 08:56:51 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[confusion]]></category>
		<category><![CDATA[Onet.xml]]></category>
		<category><![CDATA[Site-Definition]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=234</guid>
		<description><![CDATA[Last week I nearly fell of my chair I was sitting on. I found a kb article filed under http://support.microsoft.com/kb/898631/en-us. This articles describes what is supported and what is not supported regarding site definitions within SharePoint. We do not support modifying a custom site definition or a custom area definition after you create a new [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I nearly fell of my chair I was sitting on. I found a kb article filed under <a href="http://support.microsoft.com/kb/898631/en-us">http://support.microsoft.com/kb/898631/en-us</a>. This articles describes what is supported and what is not supported regarding site definitions within SharePoint.</p>
<blockquote><p><span style="color: #888888;"><em>We do not support modifying a custom site definition or a custom area definition after you create a new site or a new portal area by using that site definition or area definition. Additionally, we do not support modifying the .xml files or the .aspx files in the custom site definition or in the custom area definition after you deploy the custom site definition or the custom area definition.</em></span></p></blockquote>
<p>So site definitions are a one way ticket. All your requirements (even future ones) must be implemented before you actually create sites based on your site definition! This is far from &#8220;real life&#8221;.</p>
<p>This &#8220;supported and unsupported-link&#8221; is not referenced within the SDK (MOSS or WSS). The SDK describes the nice way of creating site definitions, how to deploy them e cetera. Once deployed your site definition <strong>has to be immutable</strong>! But this fact is not mentioned inside the SDK!<br />
Even more confusion is spread when you want to lock down SharePoint Designer (which is now available for free) following Microsoft&#8217;s kb article filed under <a href="http://support.microsoft.com/kb/940958/en-us">http://support.microsoft.com/kb/940958/en-us</a>. If you read the article you will see that it suggests to modify the existing onet.xml files so that the changes <strong>also affects already provisioned sites</strong>.</p>
<p>Microsoft tells us that changing the site definition after sites have been provisioned with it is unsupported but on the other hand writes a kb article where site definitions should be modified to reflect changes to already provisioned sites! Another example of how difficult communication is!</p>
<h3>Conclusion</h3>
<p>SharePoint is a static environment when you rely on the &#8220;xml-ways&#8221; of customizing SharePoint. This issue also appears when using Content Types. Once a Content Type is deployed Microsoft &#8220;does not support&#8221; changes in the Content Type xml-definition.</p>
<p>What gets clear when reading the kb article (<a href="http://support.microsoft.com/kb/898631/en-us">http://support.microsoft.com/kb/898631/en-us</a>) is that changing/updating via code is always supported. Perhaps its time to move away from the xml-based declarative approach to the code-based approach.</p>
<p>Lets hope <a href="http://blogs.msdn.com/sharepoint/archive/2009/04/14/microsoft-sharepoint-14-is-now-microsoft-sharepoint-2010.aspx">SharePoint 2010</a> will fix all these issues!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2009/04/19/site-definitions-within-sharepoint-are-useless/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make accidentally &#8220;hidden&#8221; pages in meeting workspaces visible</title>
		<link>http://www.entwicklungsgedanken.de/2009/03/18/how-to-make-accidentally-hidden-pages-in-meeting-workspaces-visible/</link>
		<comments>http://www.entwicklungsgedanken.de/2009/03/18/how-to-make-accidentally-hidden-pages-in-meeting-workspaces-visible/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 11:50:14 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Checkout]]></category>
		<category><![CDATA[Hidden]]></category>
		<category><![CDATA[Meeting]]></category>
		<category><![CDATA[Pages]]></category>
		<category><![CDATA[Tabs]]></category>
		<category><![CDATA[Workspace]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=195</guid>
		<description><![CDATA[A customer of  mine recently had a problem with pages (theses pages appear as tabs) inside a meeting workspace. Only the author of the page was able to see the page. No other user (even me as Site-Collection-Admin) was not able to see or access the page. It comes to my mind that the page [...]]]></description>
			<content:encoded><![CDATA[<p>A customer of  mine recently had a problem with pages (theses pages appear as tabs) inside a meeting workspace. Only the author of the page was able to see the page. No other user (even me as Site-Collection-Admin) was not able to see or access the page. It comes to my mind that the page is possibly checked-out by the user …</p>
<h3>Disguise</h3>
<p>Unfortunately the list where the pages reside is hidden to the UI. So the user has no option to check-in the created page. The only way to access the list is to retrieve the id of the &#8220;pages-list&#8221; (e.g. via SharePoint Manager). Now you can pass it to the <code>ManageCheckedOutFiles.aspx</code> inside the <code>_layouts</code>-folder. Alternatively you can connect via SharePoint Designer and uncheck the “hide in browser”-option.</p>
<p>Your url looks like this: http://myserver/myweb/_layouts/ManageCheckedOutFiles.aspx?List=%7B6F145CFF%2D8779%2D4D38%2D8B11%2D6B37EBA0A76C%7D</p>
<p>You are now able to “overtake” the checked-out page for yourself for further editing. But your <strong>odyssey is not yet over</strong>!</p>
<p><span style="color: #ff6600;">If you want to check-in the document you get an error. It’s simply not possible! What helps is:<br />
</span></p>
<ol>
<li><span style="color: #ff6600;">Copy the affected page with SharePoint-Designer<br />
</span></li>
<li><span style="color: #ff6600;">Paste it into the “pages-list”</span></li>
<li><span style="color: #ff6600;">Delete the old checked-out page</span></li>
<li><span style="color: #ff6600;">Rename the pasted page to the old page name</span></li>
<li><span style="color: #ff6600;">Now your page is fully visible!</span></li>
</ol>
<h3>Prepare for the future</h3>
<p>Because the pages-list does not have any views defined its hard to help users. If you have the list-id of this list you can use every management-page to customize this list (e.g. _layouts/listedit.aspx?List=%7B6F145CFF%2D8779%2D4D38%2D8B11%2D6B37EBA0A76C%7D).</p>
<h3>Conclusion</h3>
<p>I believe this is a bug. Perhaps there will be a fix. But don’t rely on it … What is really annoying is the fact that this list is a “special list” and you cannot add views to it. So if you ever get a page that does not show: use your SharePoint tools!-)</p>
<h3>Update</h3>
<p>The customer had a lot of workspaces where this has happened. This bug is really annoying! I have colored (yes that nice orange) the important part to fix this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2009/03/18/how-to-make-accidentally-hidden-pages-in-meeting-workspaces-visible/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>StaticName property differs from list to ContentType (BUG)</title>
		<link>http://www.entwicklungsgedanken.de/2009/01/07/staticname-property-differs-from-list-to-contenttype-bug/</link>
		<comments>http://www.entwicklungsgedanken.de/2009/01/07/staticname-property-differs-from-list-to-contenttype-bug/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 14:31:28 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ContentType]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[StaticName]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=148</guid>
		<description><![CDATA[Today I came across a really annoying bug inside SharePoint. Imagine you create a simple task list and you enable the management of content types. If you get into deeper analysis of the fields inside that list you will notice that the name of the &#8220;Status&#8221; field differs from the one used inside the content-type [...]]]></description>
			<content:encoded><![CDATA[<p>Today I came across a really annoying bug inside SharePoint. Imagine you create a simple task list and you enable the management of content types. If you get into deeper analysis of the fields inside that list you will notice that the name of the &#8220;Status&#8221; field differs from the one used inside the content-type &#8220;Task&#8221;.</p>
<h3>Flow of actions</h3>
<p>Here is what I did&#8230;</p>
<table border="0">
<tbody>
<tr>
<td><a href="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/settings.png"><img class="alignnone size-thumbnail wp-image-152" title="settings" src="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/settings-150x150.png" alt="settings" width="150" height="150" /></a></td>
<td>Enable ContentType-Management</td>
</tr>
<tr>
<td><a href="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/overview.png"><img class="alignnone size-thumbnail wp-image-149" title="overview" src="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/overview-150x150.png" alt="overview" width="150" height="150" /></a></td>
<td>List-Overview with enabled ContentType-Management. The ContentType &#8220;Task&#8221; is attached to the list.</td>
</tr>
<tr>
<td><a href="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct.png"><img class="alignnone size-thumbnail wp-image-151" title="ct" src="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct-150x150.png" alt="ct" width="150" height="150" /></a></td>
<td>Field overview of the ContentType inside the &#8220;Task-List&#8221;. The field Status is named &#8220;Status&#8221;.</td>
</tr>
<tr>
<td><a href="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct-field.png"><img class="alignnone size-thumbnail wp-image-154" title="ct-field" src="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct-field-150x150.png" alt="ct-field" width="150" height="150" /></a></td>
<td>Properties of the Field of the ContentType &#8220;Task&#8221; inside the list. The StaticName of the field is &#8220;Status&#8221; as one can see inside the red ellipse.</td>
</tr>
<tr>
<td><a href="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct-base.png"><img class="alignnone size-thumbnail wp-image-150" title="ct-base" src="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct-base-150x150.png" alt="ct-base" width="150" height="150" /></a></td>
<td>The fields available when navigating to the properties of the ContentType &#8220;Task&#8221; inside the &#8220;Site Content Type Gallery&#8221; of the site collection. <strong>Note:</strong> One can already see that the &#8220;Status-Column&#8221; is named &#8220;Task Status&#8221; here.</td>
</tr>
<tr>
<td><a href="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct-base-field.png"><img class="alignnone size-thumbnail wp-image-153" title="ct-base-field" src="http://www.entwicklungsgedanken.de/wp-content/uploads/2009/01/ct-base-field-150x150.png" alt="ct-base-field" width="150" height="150" /></a></td>
<td>If you navigate deeper into the field properties of the base ContentType &#8220;Task&#8221; you see (inside the red ellipse) that here the StaticName is &#8220;TaskStatus&#8221;.</td>
</tr>
</tbody>
</table>
<h3>Bug</h3>
<p>This is definitely a bug. These StaticName properties of the fields should <strong>be the same</strong>! What is even more weird is the fact that the Id&#8217;s of the fields are identical! Both have a guid of &#8220;c15b34c3-ce7d-490a-b133-3f4de8801b76&#8243;!</p>
<p>If you look inside the schema.xml of the default task list (found in <code>12/Template/Features/TaskList/Tasks/schema.xml</code>) you see that the StaticName is set to &#8220;Status&#8221;. If you take a look inside the ContentType-definitions of the sharepoint-core (found in <code>12/Templates/Features/ctypes/ctypeswss.xml</code>) you will notice that the name of the field with the id &#8220;c15b34c3-ce7d-490a-b133-3f4de8801b76&#8243; is set to &#8220;Status&#8221;, too.</p>
<p>So I cannot explain why the fields in the ContentType &#8220;Task&#8221; are prefixed with &#8220;Task&#8221;. The field DueDate is also affected. Inside lists its StaticName is &#8220;DueDate&#8221; inside the ContentType its named &#8220;TaskDueDate&#8221;.</p>
<h3>Conclusion</h3>
<p>It seems that you can&#8217;t even rely on the StaticName! Instead always make use of the Id of a field!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2009/01/07/staticname-property-differs-from-list-to-contenttype-bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>One worse SharePoint Design-Weakness (BUG)</title>
		<link>http://www.entwicklungsgedanken.de/2008/08/08/one-worse-sharepoint-design-weakness-bug/</link>
		<comments>http://www.entwicklungsgedanken.de/2008/08/08/one-worse-sharepoint-design-weakness-bug/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 07:41:48 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[newline]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=62</guid>
		<description><![CDATA[Like every software SharePoint has bugs too. Nothing unusual. But this bug drives my crazy &#8230; Web Service To work with SharePoint one has the option to use the &#8220;in-memory object model&#8221; or via Web Services. If your are dealing with SPListItems you will likely be using the List-Service and one of its methods GetListItems [...]]]></description>
			<content:encoded><![CDATA[<p>Like every software SharePoint has bugs too. Nothing unusual. But this bug drives my crazy &#8230;</p>
<h3>Web Service</h3>
<p>To work with SharePoint one has the option to use the &#8220;in-memory object model&#8221; or via Web Services. If your are dealing with SPListItems you will likely be using the <a href="http://msdn.microsoft.com/en-us/library/lists.lists_members.aspx">List-Service</a> and one of its methods <a href="http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems.aspx">GetListItems</a> to fetch the items stored in a list. Nothing dramatic here.</p>
<p>The response will look like this (taken from the MSDN)</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listitems</span> <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882&quot;</span> </span>
<span style="color: #009900;">   <span style="color: #000066;">xmlns:dt</span>=<span style="color: #ff0000;">&quot;uuid:C2F41010-65B3-11d1-A29F-00AA00C14882&quot;</span> </span>
<span style="color: #009900;">   <span style="color: #000066;">xmlns:rs</span>=<span style="color: #ff0000;">&quot;urn:schemas-microsoft-com:rowset&quot;</span> <span style="color: #000066;">xmlns:z</span>=<span style="color: #ff0000;">&quot;#RowsetSchema&quot;</span> </span>
<span style="color: #009900;">   <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/sharepoint/soap/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rs:data</span> <span style="color: #000066;">ItemCount</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;z:row</span> <span style="color: #000066;">ows_Number_Field</span>=<span style="color: #ff0000;">&quot;6555.00000000000&quot;</span> </span>
<span style="color: #009900;">         <span style="color: #000066;">ows_Created</span>=<span style="color: #ff0000;">&quot;2003-06-18T03:41:09Z&quot;</span> </span>
<span style="color: #009900;">         <span style="color: #000066;">ows_ID</span>=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #000066;">ows_owshiddenversion</span>=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;z:row</span> <span style="color: #000066;">ows_Number_Field</span>=<span style="color: #ff0000;">&quot;78905456.0000000&quot;</span> </span>
<span style="color: #009900;">         <span style="color: #000066;">ows_Created</span>=<span style="color: #ff0000;">&quot;2003-06-18T17:15:58Z&quot;</span> </span>
<span style="color: #009900;">         <span style="color: #000066;">ows_ID</span>=<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #000066;">ows_owshiddenversion</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rs:data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listitems<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>As you see each item is represented by a <code>z:row</code> item in the xml-markup. Each field (column) is represented by a <code>xml-attribute</code> (ows_ID, ows_MyStaticFieldName).</p>
<h3>Lets take their newlines from them</h3>
<p>The trouble just started. If you have a field of type <code>node</code> which has multiline support all your newlines are now <strong>killed</strong> and transformed to spaces by the xml-parser!! I repeat you don&#8217;t have newlines anymore when fetching multiline-fields via the Web Service of SharePoint.</p>
<h3>Believe it</h3>
<p>
Microsoft <a href="http://support.microsoft.com/kb/928316">seems to be aware</a> of this nice bug and it looks like this bug is known for a while. So why wasn&#8217;t this fixed in SP1?!
</p>
<p>
The famous w3c <a href="http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping">shows</a> how to handle newlines (and other special characters) in xml-attributes. So a simple (html-) encoding of special characters would solve the problem. But that was to easy to implement in SharePoint?! I don&#8217;t know&#8230;
</p>
<p>
The workaround (as stated in <a href="http://support.microsoft.com/kb/928316">KB928316</a>) &#8220;creating a custom Web Service&#8221; works fine. You create your own Web Service and can now correctly encode the data or simply put the values inside the xml-node.
</p>
<h3>Conclusion</h3>
<p>
I cannot believe you have to do this! It takes extra time no one would think about or pay for.
</p>
<p>In my opinion the Web Service of SharePoint becomes totally useless.<br />
I haven&#8217;t tested it which richtext-fields but I fear problems will occur there, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2008/08/08/one-worse-sharepoint-design-weakness-bug/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
