U4-3911 - Datatypes changes their uniqueID on first save

Created by Per Ploug 18 Dec 2013, 11:42:35 Updated by Shannon Deminick 18 Dec 2013, 23:26:23

On a new install, the textstring datatype is stored in umbracoNode table with a unique guid: '0CC0EBA1-9960-42C9-BF9B-60E150B429AE'

But when saved the first time, this guid changes into: "FFFFFFA8-0000-0000-0000-000000000000" saved the second time, the guid doesnt change anymore.

The uniqueID in the umbracoNode table has nothing todo with the type of property editor, so it should never change.


Shannon Deminick 18 Dec 2013, 23:23:28

The problem was due to the mapping the DataTypeSave model to the existing IDataTypeDefinition model. Unfortunately the underlying EntityBasic model that DataTypeSave inherits from contains a 'Key' property - which is always Guid.Empty for a DataTypeSave (since we don't care about this value when saving a data type). When performing the map from a DataTypeSave to an existing IDataTypeDefinition, the 'Key' on the existing item gets overwritten with an empty GUID, the subsystem then generates a new one based on the ID and it gets overwritten in the database.

Easy fix - we just ensure to ignore the Key property in the AutoMapper setup for the DataTypeSave -> IDataTypeDefinition mapping.

Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.1

Due in version: 7.0.2


Story Points: