StaticName property differs from list to ContentType (BUG)

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!

2 Comments

  • pwr

    If you look in the following file, you’ll see the cause of the problem:

    12/Template/Features/Fields/fieldswss.xml

    The definition of the field “c15b34c3-ce7d-490a-b133-3f4de8801b76” has a name, display name and static name of “TaskStatus”. This is inconsistent with its definition in the files you identify above…

    Similar behaviour is observed with DueDate (sometimes it’s TaskDueDate) – the guid is “cd21b4c2-6841-4f9e-a23a-738a65f99889”.

  • Eric Bartels

    Hi pwr,

    I found that too but I cannot really image why it is the way it is …