diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec
index 1b46661d82..a42f103856 100644
--- a/build/NuSpecs/UmbracoCms.Core.nuspec
+++ b/build/NuSpecs/UmbracoCms.Core.nuspec
@@ -17,6 +17,7 @@
+
diff --git a/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs b/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs
new file mode 100644
index 0000000000..3aa4321071
--- /dev/null
+++ b/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Linq;
+using System.Xml.Linq;
+using Umbraco.Core.IO;
+using Umbraco.Core.Logging;
+
+namespace Umbraco.Core.Configuration
+{
+ internal class ClientDependencyConfiguration
+ {
+ private readonly string _fileName;
+
+ public ClientDependencyConfiguration()
+ {
+ _fileName = IOHelper.MapPath(string.Format("{0}/ClientDependency.config", SystemDirectories.Config));
+ }
+
+ ///
+ /// Increases the version number in ClientDependency.config by 1
+ ///
+ internal bool IncreaseVersionNumber()
+ {
+ try
+ {
+ var clientDependencyConfigXml = XDocument.Load(_fileName, LoadOptions.PreserveWhitespace);
+ if (clientDependencyConfigXml.Root != null)
+ {
+
+ var versionAttribute = clientDependencyConfigXml.Root.Attribute("version");
+
+ int oldVersion;
+ int.TryParse(versionAttribute.Value, out oldVersion);
+ var newVersion = oldVersion + 1;
+
+ versionAttribute.SetValue(newVersion);
+ clientDependencyConfigXml.Save(_fileName, SaveOptions.DisableFormatting);
+
+ LogHelper.Info(string.Format("Updated version number from {0} to {1}", oldVersion, newVersion));
+ return true;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Error("Couldn't update ClientDependency version number", ex);
+ }
+
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs
index 095759eea9..f3b2536cc1 100644
--- a/src/Umbraco.Core/IO/IOHelper.cs
+++ b/src/Umbraco.Core/IO/IOHelper.cs
@@ -222,7 +222,7 @@ namespace Umbraco.Core.IO
{
foreach (var character in Path.GetInvalidFileNameChars())
{
- filePath = filePath.Replace(character, '_');
+ filePath = filePath.Replace(character, '-');
}
}
else
@@ -242,10 +242,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;
}
}
}
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index ec53a45a9a..1b70064885 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -105,6 +105,7 @@
+
diff --git a/src/Umbraco.Tests/PluginManagerTests.cs b/src/Umbraco.Tests/PluginManagerTests.cs
index 4b690d6271..3bbd495fc4 100644
--- a/src/Umbraco.Tests/PluginManagerTests.cs
+++ b/src/Umbraco.Tests/PluginManagerTests.cs
@@ -268,7 +268,7 @@ namespace Umbraco.Tests
public void Resolves_Attributed_Trees()
{
var trees = PluginManager.Current.ResolveAttributedTrees();
- Assert.AreEqual(27, trees.Count());
+ Assert.AreEqual(25, trees.Count());
}
[Test]
@@ -282,7 +282,7 @@ namespace Umbraco.Tests
public void Resolves_Trees()
{
var trees = PluginManager.Current.ResolveTrees();
- Assert.AreEqual(36, trees.Count());
+ Assert.AreEqual(34, trees.Count());
}
[Test]
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index 09bd34d63e..a7faf4ab0b 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -399,6 +399,7 @@
UI.xml
+
@@ -639,6 +640,7 @@
+
@@ -658,6 +660,7 @@
+
@@ -679,6 +682,7 @@
+
@@ -697,6 +701,7 @@
+
@@ -718,6 +723,7 @@
+
@@ -747,6 +753,7 @@
+
@@ -775,6 +782,7 @@
+
@@ -827,13 +835,20 @@
+
+
+
+
+
+
+
@@ -849,6 +864,7 @@
+
@@ -878,6 +894,7 @@
+
@@ -901,6 +918,7 @@
+
@@ -929,6 +947,7 @@
+
@@ -951,6 +970,7 @@
+
@@ -970,6 +990,8 @@
+
+
@@ -982,6 +1004,8 @@
+
+
@@ -989,6 +1013,7 @@
+
@@ -996,6 +1021,7 @@
+
@@ -1006,6 +1032,8 @@
+
+
@@ -1043,6 +1071,7 @@
+
@@ -1173,6 +1202,8 @@
+
+
diff --git a/src/Umbraco.Web.UI/config/trees.Release.config b/src/Umbraco.Web.UI/config/trees.Release.config
index aa1792c298..861161d69f 100644
--- a/src/Umbraco.Web.UI/config/trees.Release.config
+++ b/src/Umbraco.Web.UI/config/trees.Release.config
@@ -20,8 +20,6 @@
-
-
diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config
index 3d6797386d..e73f851257 100644
--- a/src/Umbraco.Web.UI/config/trees.config
+++ b/src/Umbraco.Web.UI/config/trees.config
@@ -16,8 +16,6 @@
-
-
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index 26e75659f8..d53a84f417 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -1660,8 +1660,6 @@
-
-
diff --git a/src/Umbraco.Web/umbraco.presentation/install/steps/theend.ascx.cs b/src/Umbraco.Web/umbraco.presentation/install/steps/theend.ascx.cs
index 5e3d5b3fdf..66d88de694 100644
--- a/src/Umbraco.Web/umbraco.presentation/install/steps/theend.ascx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/install/steps/theend.ascx.cs
@@ -33,6 +33,10 @@ namespace umbraco.presentation.install.steps
//errorLiteral.Text = ex.ToString();
}
+ // Update ClientDependency version
+ var clientDependencyConfig = new ClientDependencyConfiguration();
+ var clientDependencyUpdated = clientDependencyConfig.IncreaseVersionNumber();
+
if (!cms.businesslogic.skinning.Skinning.IsStarterKitInstalled())
customizeSite.Visible = false;
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadCache.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadCache.cs
deleted file mode 100644
index 8e57a309b1..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadCache.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.IO;
-using System.Text;
-using System.Web;
-using System.Xml;
-using System.Configuration;
-using umbraco.BasePages;
-using umbraco.BusinessLogic;
-using umbraco.businesslogic;
-using umbraco.cms.businesslogic;
-using umbraco.cms.businesslogic.cache;
-using umbraco.cms.businesslogic.contentitem;
-using umbraco.cms.businesslogic.datatype;
-using umbraco.cms.businesslogic.language;
-using umbraco.cms.businesslogic.media;
-using umbraco.cms.businesslogic.member;
-using umbraco.cms.businesslogic.property;
-using umbraco.cms.businesslogic.web;
-using umbraco.interfaces;
-using umbraco.DataLayer;
-using umbraco.BusinessLogic.Utils;
-using umbraco.cms.presentation.Trees;
-using umbraco.BusinessLogic.Actions;
-
-
-namespace umbraco
-{
- ///
- /// Handles loading of the cache application into the developer application tree
- ///
- [Tree("developer", "cacheBrowser", "Cache Browser")]
- public class loadCache : BaseTree
- {
- public loadCache(string application) : base(application) { }
-
- protected override void CreateRootNode(ref XmlTreeNode rootNode)
- {
- rootNode.NodeType = "init" + TreeAlias;
- rootNode.NodeID = "init";
- }
-
- protected override void CreateRootNodeActions(ref List actions)
- {
- actions.Clear();
- actions.Add(ActionRefresh.Instance);
- }
-
- protected override void CreateAllowedActions(ref List actions)
- {
- actions.Clear();
- actions.Add(ActionRefresh.Instance);
- }
-
- public override void RenderJS(ref StringBuilder Javascript) { }
-
- public override void Render(ref XmlTree tree)
- {
- Hashtable ht = Cache.ReturnCacheItemsOrdred();
-
- foreach (string key in ht.Keys)
- {
- //each child will need to load a CacheItem instead of a Cache tree so
- //we'll create a loadCacheItem object in order to get it's serivce url and alias properties
- loadCacheItem loadCacheItemTree = new loadCacheItem(this.app);
- int itemCount = ((ArrayList)ht[key]).Count;
- XmlTreeNode xNode = XmlTreeNode.Create(loadCacheItemTree);
- xNode.NodeID = key;
- xNode.Text = key + " (" + itemCount + ")";
- xNode.Action = string.Empty;
- xNode.Source = loadCacheItemTree.GetTreeServiceUrl(key);
- xNode.Icon = "developerCacheTypes.gif";
- xNode.OpenIcon = "developerCacheTypes.gif";
- xNode.HasChildren = itemCount > 0;
-
- OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
- if (xNode != null)
- {
- tree.Add(xNode);
- OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
- }
-
- }
- }
-
- }
-
-}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadCacheItem.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadCacheItem.cs
deleted file mode 100644
index 4c6a670052..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadCacheItem.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.IO;
-using System.Text;
-using System.Web;
-using System.Xml;
-using System.Configuration;
-using umbraco.BasePages;
-using umbraco.BusinessLogic;
-using umbraco.businesslogic;
-using umbraco.cms.businesslogic;
-using umbraco.cms.businesslogic.cache;
-using umbraco.cms.businesslogic.contentitem;
-using umbraco.cms.businesslogic.datatype;
-using umbraco.cms.businesslogic.language;
-using umbraco.cms.businesslogic.media;
-using umbraco.cms.businesslogic.member;
-using umbraco.cms.businesslogic.property;
-using umbraco.cms.businesslogic.web;
-using umbraco.interfaces;
-using umbraco.DataLayer;
-using umbraco.BusinessLogic.Utils;
-using umbraco.cms.presentation.Trees;
-using umbraco.BusinessLogic.Actions;
-
-
-namespace umbraco
-{
- ///
- /// Handles loading of each individual cache items into the application tree under the cache application
- ///
- [Tree("developer", "CacheItem", "Cache Item", initialize: false)]
- public class loadCacheItem : BaseTree
- {
- public loadCacheItem(string application) : base(application) { }
-
- protected override void CreateRootNode(ref XmlTreeNode rootNode)
- {
- rootNode.NodeType = "init" + TreeAlias;
- rootNode.NodeID = "init";
- }
-
- protected override void CreateRootNodeActions(ref List actions)
- {
- actions.Clear();
- actions.Add(ActionRefresh.Instance);
- }
-
- protected override void CreateAllowedActions(ref List actions)
- {
- actions.Clear();
- actions.Add(ActionRefresh.Instance);
- }
-
- ///
- /// Renders the javascript.
- ///
- /// The javascript.
- public override void RenderJS(ref StringBuilder Javascript)
- {
- Javascript.Append(
- @"
-function openCacheItem(id) {
- UmbClientMgr.contentFrame('developer/cache/viewCacheItem.aspx?key=' + id);
-}
-");
- }
-
- public override void Render(ref XmlTree tree)
- {
- Hashtable ht = Cache.ReturnCacheItemsOrdred();
-
- ArrayList a = (ArrayList)ht[this.NodeKey];
-
- for (int i = 0; i < a.Count; i++)
- {
- XmlTreeNode xNode = XmlTreeNode.Create(this);
- xNode.NodeID = a[i].ToString();
- xNode.Text = a[i].ToString();
- xNode.Action = "javascript:openCacheItem('" + a[i] + "');";
- xNode.Icon = "developerCacheItem.gif";
- xNode.OpenIcon = "developerCacheItem.gif";
-
- OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
- if (xNode != null)
- {
- tree.Add(xNode);
- OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
- }
-
- }
- }
-
- }
-
-}
diff --git a/src/umbraco.cms/businesslogic/Dictionary.cs b/src/umbraco.cms/businesslogic/Dictionary.cs
index 3d11d9e855..80646d9f65 100644
--- a/src/umbraco.cms/businesslogic/Dictionary.cs
+++ b/src/umbraco.cms/businesslogic/Dictionary.cs
@@ -359,7 +359,7 @@ namespace umbraco.cms.businesslogic
Item.removeText(UniqueId);
// remove key from database
- SqlHelper.ExecuteNonQuery("delete from cmsDictionary where [key] ='" + key + "'");
+ SqlHelper.ExecuteNonQuery("delete from cmsDictionary where [key] = @key", SqlHelper.CreateParameter("@key", key));
// Remove key from cache
DictionaryItems.Remove(key);
diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs
index 2b3df3fe79..636b1900e6 100644
--- a/src/umbraco.cms/businesslogic/web/Document.cs
+++ b/src/umbraco.cms/businesslogic/web/Document.cs
@@ -778,11 +778,15 @@ namespace umbraco.cms.businesslogic.web
{
get
{
+ // get all nodes in the path to the document, and get all matching published documents
+ // the difference should be zero if everything is published
+ // test nodeObjectType to make sure we only count _content_ nodes
int x = SqlHelper.ExecuteScalar(@"select count(node.id) - count(doc.nodeid)
from umbracoNode as node
left join cmsDocument as doc on (node.id=doc.nodeId and doc.published=1)
-where '" + Path + ",' like " + SqlHelper.Concat("node.path", "',%'"));
- return (x == 1);
+where '" + Path + ",' like " + SqlHelper.Concat("node.path", "',%'") + @"
+and node.nodeObjectType='C66BA18E-EAF3-4CFF-8A22-41B16D66A972'");
+ return (x == 0);
}
}