U4-5414 - YSOD - Renaming Property Tabs on a Document / Media Type can cause a duplicate row in cmsPropertyTypeGroup table

Created by Tim Anderson 28 Aug 2014, 13:40:51 Updated by Shannon Deminick 26 Jun 2017, 06:40:03

Relates to: U4-5769

When renaming property tabs on a document / media type in the umbraco back office - if using nested / inherited document types the renaming process does not propagate fully down the tree and causes a YSOD when adding further properties in a nested type. This is because Umbraco will create a duplicate row in the cmsPropertyTypeGroup table (I assume because the parentGroupId, contenttypeNodeId and text columns are used to determine if a new row should be created and not just the parentGroupId and contenttypeNodeId columns)

To replicate - go to settings and create two document types one which is a child of the other.

Document Type Parent (A) - Document Type Child (B)

  • Add a tab called MyTabName to (A)
  • Add a new property to MyTabName on (B)
  • Rename tab MyTabName to MyNewTabName on (A)
  • Add a new property to MyNewTabName on (B)

On reload a YSOD occurs - because a duplicate row in the cmsPropertyTypeGroup table has been created and Umbraco is expecting to find 1 row with matching (parentGroupId / contenttypeNodeId) but instead finds 2, you will find in the table something similar to:

id | parentGroupId | contenttypeNodeId | text | sortorder 29 | NULL | 1096 | MyNewTabName | 1 30 | 29 | 1097 | MyTabName | 1 31 | 29 | 1097 | MyNewTabName | 1

This can be fixed by updating all properties in the cmsPropertyType table whose 'propertyTypeGroupId' column is set to the new row Id (31 in this case) to the old row, deleting the new row from cmsPropertyTypeGroup, and changing the text to the updated text name in the old row (30 in this example)

I assume that when renaming the tab from MyTabName to MyNewTabName the other rows in the cmsPropertyTypeGroup table are not being updated which causes this situation.

(In this case only row with id 29 was updated, not row 30 which therefore caused umbraco to create row 31 due to the text mismatch in the database table....)

Have not tested this on v7 of umbraco but this issue is present in the following 6.X releases I have used and listed

Comments

Shannon Deminick 26 Jun 2017, 06:40:03

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category: Architecture

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.2.0, 6.1.6, 6.2.1, 6.2.2

Due in version:

Sprint:

Story Points:

Cycle: