From e6178efcfb1b7a1517434446bbbf6304411c1762 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 7 Jan 2013 08:12:53 -0100 Subject: [PATCH 1/4] Duplicating fix for U4-483 so that this also fixes U4-1391 in the 4.11.x branch --- src/Umbraco.Core/IO/IOHelper.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs index 87ea1cfa9a..a53ae8d924 100644 --- a/src/Umbraco.Core/IO/IOHelper.cs +++ b/src/Umbraco.Core/IO/IOHelper.cs @@ -220,7 +220,7 @@ namespace Umbraco.Core.IO { foreach (var character in Path.GetInvalidFileNameChars()) { - filePath = filePath.Replace(character, '_'); + filePath = filePath.Replace(character, '-'); } } else @@ -240,10 +240,14 @@ namespace Umbraco.Core.IO if (reservedCharacters.IndexOf(character) == -1) stringBuilder.Append(character); else - stringBuilder.Append("_"); + stringBuilder.Append("-"); } - return stringBuilder.ToString(); + // Remove repeating dashes + // From: http://stackoverflow.com/questions/5111967/regex-to-remove-a-specific-repeated-character + var reducedString = Regex.Replace(stringBuilder.ToString(), "-+", "-"); + + return reducedString; } } } From ce6711b587856f6218dff0dbfb32c3ab82132a9a Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 9 Jan 2013 13:58:55 -0100 Subject: [PATCH 2/4] Duplicate fix (ce2f47c11322) #U4-1366 - conflict with partial view macro engine. --- .../Macros/PartialViewMacroEngine.cs | 29 ++++++++---- .../businesslogic/macro/MacroEngineFactory.cs | 45 ++++++++++++++++--- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs b/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs index 28e558e358..2b56940e4c 100644 --- a/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs +++ b/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs @@ -57,14 +57,27 @@ namespace Umbraco.Web.Macros { get { return EngineName; } } - public IEnumerable SupportedExtensions - { - get { return new[] {"cshtml", "vbhtml"}; } - } - public IEnumerable SupportedUIExtensions - { - get { return new[] { "cshtml", "vbhtml" }; } - } + + //NOTE: We do not return any supported extensions because we don't want the MacroEngineFactory to return this + // macro engine when searching for engines via extension. Those types of engines are reserved for files that are + // stored in the ~/macroScripts folder and each engine must support unique extensions. This is a total Hack until + // we rewrite how macro engines work. + public IEnumerable SupportedExtensions + { + get { return Enumerable.Empty(); } + //get { return new[] {"cshtml", "vbhtml"}; } + } + + //NOTE: We do not return any supported extensions because we don't want the MacroEngineFactory to return this + // macro engine when searching for engines via extension. Those types of engines are reserved for files that are + // stored in the ~/macroScripts folder and each engine must support unique extensions. This is a total Hack until + // we rewrite how macro engines work. + public IEnumerable SupportedUIExtensions + { + get { return Enumerable.Empty(); } + //get { return new[] { "cshtml", "vbhtml" }; } + } + public Dictionary SupportedProperties { get { throw new NotSupportedException(); } diff --git a/src/umbraco.cms/businesslogic/macro/MacroEngineFactory.cs b/src/umbraco.cms/businesslogic/macro/MacroEngineFactory.cs index aab0899de2..961261b0c3 100644 --- a/src/umbraco.cms/businesslogic/macro/MacroEngineFactory.cs +++ b/src/umbraco.cms/businesslogic/macro/MacroEngineFactory.cs @@ -49,25 +49,56 @@ namespace umbraco.cms.businesslogic.macro EnsureInitialize(); } - public static IEnumerable GetSupportedLanguages() { + /// + /// Returns a collectino of MacroEngineLanguage objects, each of which describes a file extension and an associated macro engine + /// + /// + /// + /// Until the macro engines are rewritten, this method explicitly ignores the PartialViewMacroEngine because this method + /// is essentially just used for any macro engine that stores it's files in the ~/macroScripts folder where file extensions + /// cannot overlap. + /// + [Obsolete("This method is not used and will be removed from the codebase in the future")] + public static IEnumerable GetSupportedLanguages() + { var languages = new List(); - foreach(var engine in GetAll()) { - foreach(string lang in engine.SupportedExtensions) + foreach (var engine in GetAll()) + { + foreach (string lang in engine.SupportedExtensions) + { if (languages.Find(t => t.Extension == lang) == null) + { languages.Add(new MacroEngineLanguage(lang, engine.Name)); + } + } } return languages; } - public static IEnumerable GetSupportedUILanguages() { + /// + /// Returns a collectino of MacroEngineLanguage objects, each of which describes a file extension and an associated macro engine that + /// supports file extension lookups. + /// + /// + /// + /// The PartialViewMacroEngine will never be returned in these results because it does not support searching by file extensions. See + /// the notes in the PartialViewMacroEngine regarding this. + /// + public static IEnumerable GetSupportedUILanguages() + { var languages = new List(); - foreach (var engine in GetAll()) { + foreach (var engine in GetAll()) + { foreach (string lang in engine.SupportedUIExtensions) - if (languages.Find(t => t.Extension == lang) == null) + { + if (languages.All(t => t.Extension != lang)) + { languages.Add(new MacroEngineLanguage(lang, engine.Name)); + } + } } return languages.OrderBy(s => s.Extension); - } + } public static List GetAll() { From cd0919aeeb33268daece0aacc852f724d580ee37 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 9 Jan 2013 16:03:56 -0100 Subject: [PATCH 3/4] Update version to 4.11.2 --- build/NuSpecs/UmbracoCms.Core.nuspec | 2 +- build/NuSpecs/UmbracoCms.nuspec | 4 ++-- src/Umbraco.Core/Configuration/GlobalSettings.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index 82174a539b..0597d6ce9f 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -2,7 +2,7 @@ UmbracoCms.Core - 4.11.1 + 4.11.2 Umbraco Cms Core Binaries Morten Christensen Umbraco HQ diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index be4a9342cf..193dbefd6f 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -2,7 +2,7 @@ UmbracoCms - 4.11.1 + 4.11.2 Umbraco Cms Morten Christensen Umbraco HQ @@ -15,7 +15,7 @@ en-US umbraco - + diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs index 87c31572df..b5d2f912e8 100644 --- a/src/Umbraco.Core/Configuration/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs @@ -28,7 +28,7 @@ namespace Umbraco.Core.Configuration #region Private static fields // CURRENT UMBRACO VERSION ID - private const string CurrentUmbracoVersion = "4.11.1"; + private const string CurrentUmbracoVersion = "4.11.2"; private static string _reservedUrlsCache; private static string _reservedPathsCache; From 88dc73cd6676de9bde8a9000311ff4c3cdbdfe39 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 10 Jan 2013 07:29:04 -0100 Subject: [PATCH 4/4] Fix the unpublished/pendinchanges/published display --- .../umbraco/Trees/BaseContentTree.cs | 9 +++++++-- .../umbraco.presentation/umbraco/Trees/XmlTree.cs | 7 +------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseContentTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseContentTree.cs index f343f4adbe..f2c267f8e4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseContentTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseContentTree.cs @@ -112,8 +112,13 @@ function openContent(id) { node.Icon = dd.ContentTypeIcon; node.OpenIcon = dd.ContentTypeIcon; } - if (!dd.Published) - node.Style.DimNode(); + + if (dd.Published == false) + node.Style.DimNode(); + + if (dd.HasPendingChanges()) + node.Style.HighlightNode(); + return node; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs index 314a5363ed..38eaca32c0 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs @@ -339,12 +339,7 @@ namespace umbraco.cms.presentation.Trees public bool? NotPublished { get { return m_notPublished; } - set - { - m_notPublished = value; - if (m_notPublished.HasValue && m_notPublished.Value) - this.Style.DimNode(); - } + set { m_notPublished = value; } } ///