From 715d557f32cf35581ac9d36dc324921756334292 Mon Sep 17 00:00:00 2001 From: Marek Dzikiewicz Date: Sun, 22 Nov 2015 18:25:22 +0100 Subject: [PATCH 1/8] Fix handling braces in tokens This brings Tokenizer changes from changeset 423fec90b3494a2482ec186ad521862e9ed7be1e --- .../Implementation/Tokenizer.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Implementation/Tokenizer.cs b/src/Orchard.Web/Modules/Orchard.Tokens/Implementation/Tokenizer.cs index 86be74bc6..623595560 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Implementation/Tokenizer.cs +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Implementation/Tokenizer.cs @@ -59,7 +59,7 @@ namespace Orchard.Tokens.Implementation { private static Tuple> Parse(string text, bool hashMode) { var tokens = new List(); if (!String.IsNullOrEmpty(text)) { - var inToken = false; + var inTokenDepth = 0; var tokenStart = 0; for (var i = 0; i < text.Length; i++) { var c = text[i]; @@ -70,29 +70,32 @@ namespace Orchard.Tokens.Implementation { continue; } } - else if (c == '}' && !(inToken)) { + else if (c == '}' && inTokenDepth == 0) { if (i + 1 < text.Length && text[i + 1] == '}') { text = text.Substring(0, i) + text.Substring(i + 1); continue; } } - if (inToken) { + if (inTokenDepth > 0) { if (c == '}') { - inToken = false; - var token = text.Substring(tokenStart + 1, i - tokenStart - 1); - tokens.Add(token); + inTokenDepth--; + if (inTokenDepth == 0) { + var token = text.Substring(tokenStart + 1, i - tokenStart - 1); + tokens.Add(token); + } } } - else if (!hashMode && c == '{') { - inToken = true; - tokenStart = i; + + if (!hashMode && c == '{') { + if (inTokenDepth == 0) tokenStart = i; + inTokenDepth++; } else if (hashMode && c == '#' && i + 1 < text.Length && text[i + 1] == '{' - && (i + 2 > text.Length || text[i + 2] != '{') ) { - inToken = true; - tokenStart = i+1; + && (i + 2 > text.Length || text[i + 2] != '{') ) { + if (inTokenDepth == 0) tokenStart = i+1; + inTokenDepth++; } } } From 1c4c64b8129d2bb8b6ae70eaacbfdbce3b51f63e Mon Sep 17 00:00:00 2001 From: Lombiq Date: Tue, 24 Nov 2015 17:17:12 +0100 Subject: [PATCH 2/8] Fixing that widgets with name containing dash can't have named alternates #3379 --- src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs index 23c716df5..8108f3c95 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs @@ -39,7 +39,12 @@ namespace Orchard.Widgets { widget.Classes.Add("widget-" + widgetPart.Name); // Widget__Name__[Name] - displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name); + if (widgetPart.Name.Contains("-")) { + displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name.Replace("-", "__")); + } + else { + displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name); + } } } From eb81c20f04b7eb1a643caf2a37c8db827dc3c8d3 Mon Sep 17 00:00:00 2001 From: Daniel Stolt Date: Tue, 24 Nov 2015 19:14:31 +0100 Subject: [PATCH 3/8] Set UseGlobalApplicationHostFile=True in Orchard.Web.csproj. This prevents VS2015 from creating a local applicationHost.config file in the solution, which in our case is excluded from source control anyway and therefore isn't used as intended. --- src/Orchard.Web/Orchard.Web.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index 5bd1931aa..50d922899 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -20,6 +20,7 @@ disabled false + True true @@ -239,7 +240,7 @@ - @@ -280,4 +281,4 @@ --> - \ No newline at end of file + From b9091a7889bf53ff9f2d642c53ab52abe30a71a6 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Tue, 24 Nov 2015 21:00:34 +0100 Subject: [PATCH 4/8] Removing unnecessary if when creating shape alternates --- src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs index 8108f3c95..4287421b2 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs @@ -39,12 +39,8 @@ namespace Orchard.Widgets { widget.Classes.Add("widget-" + widgetPart.Name); // Widget__Name__[Name] - if (widgetPart.Name.Contains("-")) { - displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name.Replace("-", "__")); - } - else { - displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name); - } + // Replacing dashes to shape type-compatible double underscores. + displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name.Replace("-", "__")); } } From ab12ff6a051fd6bac3cb3d58280ea0e85ac93f55 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Wed, 25 Nov 2015 15:43:37 +0100 Subject: [PATCH 5/8] Adding notes about Orchard 2 to the README --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bdbcb6c4e..1117ee3b5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Orchard is a free, open source, community-focused Content Management System buil [![Join the chat at https://gitter.im/OrchardCMS/Orchard](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OrchardCMS/Orchard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button +You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button. [![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://ms.portal.azure.com/#create/OutercurveFoundation.OrchardCMS.0.5.9) @@ -21,6 +21,7 @@ Orchard is delivered under the [.NET Foundation](http://www.dotnetfoundation.org Our mission is to empower our users and foster a dedicated and diverse community that builds the CMS that we all want to use. ## Project Status + Orchard is currently in version 1.9.2. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach. Our 1.9.2 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://docs.orchardproject.net/Documentation/Installing-Orchard). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project. @@ -31,6 +32,7 @@ Our 1.9.2 release is available from our Downloads page, and is easy to [Install * [Contact us](mailto:ofeedbk@microsoft.com) ## How To Get Involved + We hope that by engaging with the community we will continue to shape Orchard into a valuable set of tools and applications. The Orchard team is committed to open community participation and accepts code contributions. We encourage community participation at all levels from general project feedback to bug fixes and patches. There are many ways you can [contribute to Orchard](http://orchardproject.net/contribution): @@ -46,3 +48,7 @@ There are many ways you can [contribute to Orchard](http://orchardproject.net/co * [Translate Orchard](http://orchardproject.net/localize) * [Contribute modules and themes to our gallery](http://gallery.orchardproject.net/) * [Send us feedback](mailto:ofeedbk@microsoft.com) + +## The Future Of Orchard CMS: Orchard 2 + +As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard 2 is the next generation of Orchard releases that is based on [ASP.NET vNext](http://www.asp.net/vnext). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/Orchard2). Orchard 2 (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions of Orchard. \ No newline at end of file From af763050886dd6b7621cf522a5c5e89ed37cd558 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Thu, 26 Nov 2015 22:11:40 +0100 Subject: [PATCH 6/8] =?UTF-8?q?Adding=20dynamic=20Content=20property=20to?= =?UTF-8?q?=20the=20Content=20Item=20class=20for=20easily=20accessing=20Pa?= =?UTF-8?q?rts=20and=20Fields.=20Thanks=20S=C3=A9bastien!=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Orchard/ContentManagement/ContentItem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Orchard/ContentManagement/ContentItem.cs b/src/Orchard/ContentManagement/ContentItem.cs index 30dc1c34e..94e9d1b36 100644 --- a/src/Orchard/ContentManagement/ContentItem.cs +++ b/src/Orchard/ContentManagement/ContentItem.cs @@ -15,6 +15,8 @@ namespace Orchard.ContentManagement { ContentItem IContent.ContentItem { get { return this; } } + public dynamic Content { get { return (dynamic)this; } } + public int Id { get { return Record == null ? 0 : Record.Id; } } public int Version { get { return VersionRecord == null ? 0 : VersionRecord.Number; } } From 5b53671a2a76493f0fa141653fa52f65980161a5 Mon Sep 17 00:00:00 2001 From: Thierry Fleury Date: Sun, 29 Nov 2015 18:03:58 +0100 Subject: [PATCH 7/8] Revert "Removing unnecessary resolution" This reverts commit 9b91b1b2609439bb50dfc0321e72e5f39a95022f. --- src/Orchard/Mvc/MvcModule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Orchard/Mvc/MvcModule.cs b/src/Orchard/Mvc/MvcModule.cs index 33cc7176d..ab317a596 100644 --- a/src/Orchard/Mvc/MvcModule.cs +++ b/src/Orchard/Mvc/MvcModule.cs @@ -57,6 +57,7 @@ namespace Orchard.Mvc { var baseUrl = new Func(() => siteService.GetSiteSettings().BaseUrl); var httpContextBase = new HttpContextPlaceholder(baseUrl); + context.Resolve().CreateWorkContextScope(httpContextBase); return httpContextBase; } From c2dd09af5e04216eadc3e4c9e20880e12fae2e17 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Mon, 30 Nov 2015 22:50:19 +0100 Subject: [PATCH 8/8] Fixing that NavigationQueryMenuItems and BlogArchives widgets couldn't be export/imported due to the lack of an identity, fixes #3488. Since the Projections migrations is already kind of a mess --- src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs | 12 +++++++++++- .../Modules/Orchard.Projections/Migrations.cs | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs index 293b3bef0..b89cae08e 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs @@ -84,9 +84,10 @@ namespace Orchard.Blogs { .WithPart("CommonPart") .WithPart("WidgetPart") .WithSetting("Stereotype", "Widget") + .WithPart("IdentityPart") ); - return 6; + return 7; } public int UpdateFrom1() { @@ -133,5 +134,14 @@ namespace Orchard.Blogs { return 6; } + + public int UpdateFrom6() { + ContentDefinitionManager.AlterTypeDefinition("BlogArchives", + cfg => cfg + .WithPart("IdentityPart") + ); + + return 7; + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs index 8ee643ce6..51d95faf3 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs @@ -274,5 +274,14 @@ namespace Orchard.Projections { return 3; } + + public int UpdateFrom3() { + ContentDefinitionManager.AlterTypeDefinition("NavigationQueryMenuItem", + cfg => cfg + .WithPart("IdentityPart") + ); + + return 4; + } } } \ No newline at end of file