Quantcast
Channel: entwicklungsgedanken » ContentType
Viewing all articles
Browse latest Browse all 2

StaticName property differs from list to ContentType (BUG)

$
0
0

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 “Status” field differs from the one used inside the content-type “Task”.

Flow of actions

Here is what I did…

settings Enable ContentType-Management
overview List-Overview with enabled ContentType-Management. The ContentType “Task” is attached to the list.
ct Field overview of the ContentType inside the “Task-List”. The field Status is named “Status”.
ct-field Properties of the Field of the ContentType “Task” inside the list. The StaticName of the field is “Status” as one can see inside the red ellipse.
ct-base The fields available when navigating to the properties of the ContentType “Task” inside the “Site Content Type Gallery” of the site collection. Note: One can already see that the “Status-Column” is named “Task Status” here.
ct-base-field If you navigate deeper into the field properties of the base ContentType “Task” you see (inside the red ellipse) that here the StaticName is “TaskStatus”.

Bug

This is definitely a bug. These StaticName properties of the fields should be the same! What is even more weird is the fact that the Id’s of the fields are identical! Both have a guid of “c15b34c3-ce7d-490a-b133-3f4de8801b76″!

If you look inside the schema.xml of the default task list (found in 12/Template/Features/TaskList/Tasks/schema.xml) you see that the StaticName is set to “Status”. If you take a look inside the ContentType-definitions of the sharepoint-core (found in 12/Templates/Features/ctypes/ctypeswss.xml) you will notice that the name of the field with the id “c15b34c3-ce7d-490a-b133-3f4de8801b76″ is set to “Status”, too.

So I cannot explain why the fields in the ContentType “Task” are prefixed with “Task”. The field DueDate is also affected. Inside lists its StaticName is “DueDate” inside the ContentType its named “TaskDueDate”.

Conclusion

It seems that you can’t even rely on the StaticName! Instead always make use of the Id of a field!


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images