From 8052143be3af9637434c357839350a028a90a6f1 Mon Sep 17 00:00:00 2001 From: slace Date: Sat, 27 Feb 2010 00:18:22 +0000 Subject: [PATCH] DO NOT DOWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB Fixing generation of parent types in linq to umbraco [TFS Changeset #64219] --- umbraco/presentation/requestModule.cs | 2 +- umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/umbraco/presentation/requestModule.cs b/umbraco/presentation/requestModule.cs index 435e502699..f5c0985e81 100644 --- a/umbraco/presentation/requestModule.cs +++ b/umbraco/presentation/requestModule.cs @@ -175,7 +175,7 @@ namespace umbraco.presentation receivedQuery.Length - ampPos - 1); } // get umbPage out of query string (9 = "&umbPage".Length() + 1) - path = receivedQuery.Substring(9, ampPos - 9); + path = receivedQuery.Substring(9, ampPos - 9); //this will fail if there are < 9 characters before the &umbPage query string } else { diff --git a/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs b/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs index 7b571627d0..0e07154741 100644 --- a/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs +++ b/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs @@ -249,7 +249,7 @@ namespace {0} {{ if (dt.MasterContentType > 0) { var parent = DocTypes.First(d => d.Id == dt.MasterContentType); - baseType = GenerateTypeName(dt.Alias); + baseType = GenerateTypeName(parent.Alias); } sb.AppendLine(string.Format(INTERFACE_TEMPLATE, @@ -318,7 +318,7 @@ namespace {0} {{ if (dt.MasterContentType > 0) { var parent = DocTypes.First(d => d.Id == dt.MasterContentType); - baseType = GenerateTypeName(dt.Alias); + baseType = GenerateTypeName(parent.Alias); } sb.Append(string.Format(CLASS_TEMPLATE, @@ -476,6 +476,10 @@ namespace {0} {{ private static string FormatForComment(string s) { + if (string.IsNullOrEmpty(s)) + { + return s; + } return s.Replace("\r\n", "\r\n///"); } }