From 21e9abb5f62735fd84ebd0ef3a5234a3d48e091f Mon Sep 17 00:00:00 2001 From: Shandem Date: Tue, 11 May 2010 12:57:59 +0000 Subject: [PATCH] Fixes: 27008 - Removes cmsDataType record when a data type is deleted [TFS Changeset #66066] --- umbraco/cms/businesslogic/datatype/DataType.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/umbraco/cms/businesslogic/datatype/DataType.cs b/umbraco/cms/businesslogic/datatype/DataType.cs index 131408e39f..01dcb79dd1 100644 --- a/umbraco/cms/businesslogic/datatype/DataType.cs +++ b/umbraco/cms/businesslogic/datatype/DataType.cs @@ -31,10 +31,19 @@ namespace umbraco.cms.businesslogic.datatype setupDataTypeDefinition(); } + public override void delete() + { + //delete the cmsDataType role, then the umbracoNode + SqlHelper.ExecuteNonQuery("delete from cmsDataType where nodeId=@nodeId", SqlHelper.CreateParameter("@nodeId", this.Id)); + base.delete(); + + cache.Cache.ClearCacheItem(string.Format("UmbracoDataTypeDefinition{0}", Id)); + } + + [Obsolete("Use the standard delete() method instead")] public void Delete() { delete(); - cache.Cache.ClearCacheItem(string.Format("UmbracoDataTypeDefinition{0}", Id)); } ///