From 325a9e8e0a6742e1ae2d5836570e29d17fffcc33 Mon Sep 17 00:00:00 2001 From: Shandem Date: Wed, 20 Oct 2010 08:28:36 +0000 Subject: [PATCH] Fixes: 28741 - And Applied patch = NICE [TFS Changeset #78649] --- .../cms/businesslogic/datatype/DefaultData.cs | 4 +++- .../MySql/Sql/KeysIndexesAndConstraints.sql | 8 +++++++- .../datalayer/SqlHelpers/MySql/Sql/Total.sql | 13 ++++++++++++- .../SqlHelpers/MySql/Sql/Version4_Upgrade.sql | 17 ++++++++++++++++- .../umbraco/webservices/nodeSorter.asmx.cs | 15 +++++++++++++++ 5 files changed, 53 insertions(+), 4 deletions(-) diff --git a/umbraco/cms/businesslogic/datatype/DefaultData.cs b/umbraco/cms/businesslogic/datatype/DefaultData.cs index b3826c11d8..6b18ce0402 100644 --- a/umbraco/cms/businesslogic/datatype/DefaultData.cs +++ b/umbraco/cms/businesslogic/datatype/DefaultData.cs @@ -125,7 +125,9 @@ namespace umbraco.cms.businesslogic.datatype // Try to set null values if possible try { - if (value == null) + //CHANGE:by Allan Laustsen to fix copy nodes + //if (value == null) + if (value == null || (string.IsNullOrEmpty(value.ToString()) && (this._dataType.DBType == DBTypes.Integer || this._dataType.DBType == DBTypes.Date))) SqlHelper.ExecuteNonQuery("update cmsPropertyData set " + _dataType.DataFieldName + " = NULL where id = " + m_PropertyId); else SqlHelper.ExecuteNonQuery("update cmsPropertyData set " + _dataType.DataFieldName + " = @value where id = " + m_PropertyId, SqlHelper.CreateParameter("@value", value)); diff --git a/umbraco/datalayer/SqlHelpers/MySql/Sql/KeysIndexesAndConstraints.sql b/umbraco/datalayer/SqlHelpers/MySql/Sql/KeysIndexesAndConstraints.sql index bda1eba2f2..60ac035f40 100644 --- a/umbraco/datalayer/SqlHelpers/MySql/Sql/KeysIndexesAndConstraints.sql +++ b/umbraco/datalayer/SqlHelpers/MySql/Sql/KeysIndexesAndConstraints.sql @@ -9,4 +9,10 @@ NOT GOING TO BREAK UMBRACO. /* Create missing indexes and primary keys */ CREATE INDEX IX_Icon ON cmsContentType(nodeId, icon) -; \ No newline at end of file +; + +/* CHANGE:Allan Stegelmann Laustsen */ +/* Create Custom Index to speed up tree loading */ +CREATE INDEX IX_contentid_versiondate ON cmscontentversion(CONTENTID, VERSIONDATE) +; +/* CHANGE:End */ \ No newline at end of file diff --git a/umbraco/datalayer/SqlHelpers/MySql/Sql/Total.sql b/umbraco/datalayer/SqlHelpers/MySql/Sql/Total.sql index d19c5aebe5..0bf90bbcdc 100644 --- a/umbraco/datalayer/SqlHelpers/MySql/Sql/Total.sql +++ b/umbraco/datalayer/SqlHelpers/MySql/Sql/Total.sql @@ -10,7 +10,7 @@ IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT - Database version: 4.1.0.0 + Database version: 4.1.0.3 Please increment this version number if ANY change is made to this script, so compatibility with scripts for other database systems can be verified easily. @@ -814,3 +814,14 @@ CREATE TABLE cmsPreviewXml( ALTER TABLE cmsPreviewXml ADD CONSTRAINT PK_cmsContentPreviewXml PRIMARY KEY CLUSTERED (nodeId, versionId) ; + +/* Create missing indexes and primary keys */ +CREATE INDEX IX_Icon ON cmsContentType(nodeId, icon) +; + +/* CHANGE:Allan Stegelmann Laustsen */ +/* Create Custom Index to speed up tree loading */ +CREATE INDEX IX_contentid_versiondate ON cmscontentversion(CONTENTID, VERSIONDATE) +; +/* CHANGE:End */ + diff --git a/umbraco/datalayer/SqlHelpers/MySql/Sql/Version4_Upgrade.sql b/umbraco/datalayer/SqlHelpers/MySql/Sql/Version4_Upgrade.sql index de86df9560..e1f1024825 100644 --- a/umbraco/datalayer/SqlHelpers/MySql/Sql/Version4_Upgrade.sql +++ b/umbraco/datalayer/SqlHelpers/MySql/Sql/Version4_Upgrade.sql @@ -4,7 +4,10 @@ IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT - Database version: 4.1.0.2 + //CHANGE:Allan Stegelmann Laustsen + Database version: 4.1.0.3 + //CHANGE:End + Please increment this version number if ANY change is made to this script, so compatibility with scripts for other database systems can be verified easily. @@ -46,3 +49,15 @@ CREATE TABLE cmsPreviewXml( ALTER TABLE cmsPreviewXml ADD CONSTRAINT PK_cmsContentPreviewXml PRIMARY KEY CLUSTERED (nodeId, versionId) ; +ALTER TABLE cmscontentversion MODIFY COLUMN id INTEGER NOT NULL AUTO_INCREMENT +; + +/* Create missing indexes and primary keys */ +CREATE INDEX IX_Icon ON cmsContentType(nodeId, icon) +; + +/* CHANGE:Allan Stegelmann Laustsen */ +/* Create Custom Index to speed up tree loading */ +CREATE INDEX IX_contentid_versiondate ON cmscontentversion(CONTENTID, VERSIONDATE) +; +/* CHANGE:End */ \ No newline at end of file diff --git a/umbraco/presentation/umbraco/webservices/nodeSorter.asmx.cs b/umbraco/presentation/umbraco/webservices/nodeSorter.asmx.cs index dbbc874c1f..1e7a26052a 100644 --- a/umbraco/presentation/umbraco/webservices/nodeSorter.asmx.cs +++ b/umbraco/presentation/umbraco/webservices/nodeSorter.asmx.cs @@ -87,6 +87,14 @@ namespace umbraco.presentation.webservices if (helper.Request("app") == "content" | helper.Request("app") == "") isContent = true; + //CHANGE:Allan Stegelmann Laustsen, we need to know if the node is in media. + bool isMedia = false; + if (helper.Request("app") == "media") + { + isMedia = true; + } + //CHANGE:End + for (int i = 0; i < tmp.Length; i++) { if (tmp[i] != "" && tmp[i].Trim() != "") @@ -103,6 +111,12 @@ namespace umbraco.presentation.webservices library.UpdateDocumentCache(int.Parse(tmp[i])); } } + //CHANGE:Allan Laustsen, to update the sortorder of the media node in the XML, re-save the node.... + else if (isMedia) + { + new cms.businesslogic.media.Media(int.Parse(tmp[i])).Save(); + } + //CHANGE:End } } @@ -125,6 +139,7 @@ namespace umbraco.presentation.webservices if (UmbracoSettings.UseDistributedCalls) library.RefreshContent(); } + // fire actionhandler, check for content if ((helper.Request("app") == "content" | helper.Request("app") == "") && ParentId > 0)