From 4418bcdc191552b6b061a9675df12e0585e79751 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 22 Dec 2015 20:21:28 +0100 Subject: [PATCH 1/8] Fixed a bug in LayoutModelMapper. If the root Canvas is manually instantiated, it will not have a valid ElementDescriptor. --- .../Modules/Orchard.Layouts/Services/LayoutModelMapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Services/LayoutModelMapper.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Services/LayoutModelMapper.cs index 8d05c73f2..e5dafd564 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Services/LayoutModelMapper.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Services/LayoutModelMapper.cs @@ -20,7 +20,7 @@ namespace Orchard.Layouts.Services { public object ToEditorModel(string layoutData, DescribeElementsContext describeContext) { var elements = _serializer.Deserialize(layoutData, describeContext); - var canvas = elements.FirstOrDefault(x => x is Canvas) ?? new Canvas(); + var canvas = elements.FirstOrDefault(x => x is Canvas) ?? _elementManager.ActivateElement(); return ToEditorModel(canvas, describeContext); } From 49317ec33f0c756ab78c75000fc46ab46538c457 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 25 Dec 2015 14:43:43 +0100 Subject: [PATCH 2/8] Giving back Classes to the Shapes. This fixes a limitation where the Classes property on an element shape would be ignored when rendering tags using attributes returned from the TagBuilderExtensions.GetCommonElementAttributes method. --- .../Orchard.Layouts/Helpers/TagBuilderExtensions.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs index 8b68d9f7e..6609287c7 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs @@ -37,11 +37,16 @@ namespace Orchard.Layouts.Helpers { attributes["style"] = Regex.Replace(tokenize(), @"(?:\r\n|[\r\n])", ""); } + IList classes = shape.Classes; + if (!String.IsNullOrWhiteSpace(htmlClass)) { var tokenize = (Func)shape.TokenizeHtmlClass; - attributes["class"] = tokenize(); + var cssClass = tokenize(); + classes.Add(cssClass); } + attributes["class"] = String.Join(" ", classes); + return attributes; } From d1fd7cd271908ee7060d531c298cd11b0a438c19 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Mon, 28 Dec 2015 16:05:54 +0100 Subject: [PATCH 3/8] Improved class attribute logic. This change fixes that the `"class"` attribute would be added to the tag even if there are no css classes to assign. This in turn has the effect that the root `Canvas` element is not rendering its outer tags needlessly by default (only if it has at least one attribute). --- .../Orchard.Layouts/Helpers/TagBuilderExtensions.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs index 6609287c7..e8b8675a0 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Collections.Generic; +using System.Linq; using System.Text.RegularExpressions; using Orchard.DisplayManagement.Shapes; using Orchard.Layouts.Framework.Elements; @@ -45,7 +46,8 @@ namespace Orchard.Layouts.Helpers { classes.Add(cssClass); } - attributes["class"] = String.Join(" ", classes); + if(classes.Any()) + attributes["class"] = String.Join(" ", classes); return attributes; } @@ -56,4 +58,4 @@ namespace Orchard.Layouts.Helpers { } } } -} \ No newline at end of file +} From 0a8fa5b99a4690098db9a363f9369bbfc58b0fe4 Mon Sep 17 00:00:00 2001 From: andy zheng Date: Wed, 30 Dec 2015 09:56:59 -0500 Subject: [PATCH 4/8] second time to fix #6245 --- src/Orchard.Web/Modules/Orchard.Resources/Assets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Resources/Assets.json b/src/Orchard.Web/Modules/Orchard.Resources/Assets.json index 14ac76a7e..660851895 100644 --- a/src/Orchard.Web/Modules/Orchard.Resources/Assets.json +++ b/src/Orchard.Web/Modules/Orchard.Resources/Assets.json @@ -262,10 +262,10 @@ "Assets/Js/Bootstrap/collapse.js", "Assets/Js/Bootstrap/dropdown.js", "Assets/Js/Bootstrap/modal.js", + "Assets/Js/Bootstrap/tooltip.js", "Assets/Js/Bootstrap/popover.js", "Assets/Js/Bootstrap/scrollspy.js", - "Assets/Js/Bootstrap/tab.js", - "Assets/Js/Bootstrap/tooltip.js", + "Assets/Js/Bootstrap/tab.js", "Assets/Js/Bootstrap/transition.js" ], "output": "Scripts/bootstrap.js" From c8b5664d2685600120c4194b29bc53c4451deaf1 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 30 Dec 2015 17:28:23 +0100 Subject: [PATCH 5/8] Fixed a bug in HomeAliasService The bug would cause a null reference exception in case there is no alias with an empty string (the home alias). --- .../Modules/Orchard.Autoroute/Services/HomeAliasService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/HomeAliasService.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/HomeAliasService.cs index f11ba7dd3..b833ede2a 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/HomeAliasService.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/HomeAliasService.cs @@ -31,6 +31,10 @@ namespace Orchard.Autoroute.Services { public IContent GetHomePage(VersionOptions version = null) { var homePageRoute = GetHomeRoute(); + + if (homePageRoute == null) + return null; + var alias = LookupAlias(homePageRoute); if (alias == null) @@ -74,4 +78,4 @@ namespace Orchard.Autoroute.Services { return alias != null ? alias.Path : null; } } -} \ No newline at end of file +} From fde4c32affa10cf61ca7251bcca75f0009136d5d Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 30 Dec 2015 17:52:46 +0100 Subject: [PATCH 6/8] Fixed activity toolbox filtering. Due to a bug in the orchard-workflows.js script, the activity toolbox filter was broken. --- .../Modules/Orchard.Workflows/Scripts/orchard-workflows.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Workflows/Scripts/orchard-workflows.js b/src/Orchard.Web/Modules/Orchard.Workflows/Scripts/orchard-workflows.js index f9c15784e..325721a52 100644 --- a/src/Orchard.Web/Modules/Orchard.Workflows/Scripts/orchard-workflows.js +++ b/src/Orchard.Web/Modules/Orchard.Workflows/Scripts/orchard-workflows.js @@ -97,7 +97,7 @@ } else { var lowerCaseText = text.toLowerCase(); $(".activity-toolbox-item").each(function () { - var recordText = $(this).data("activity-text").toLowerCase(); + var recordText = $(this).data("activity-name").toLowerCase(); $(this).toggle(recordText.indexOf(lowerCaseText) >= 0); }); } From aaced541e33d8b9a3f0e951d80da63e20846e0c3 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Mon, 4 Jan 2016 19:09:00 +0100 Subject: [PATCH 7/8] Adding WithIdentity() content metadata helper to add IdentityPart in migrations and changing affected code to use this --- .../Extensions/CommonMetaDataExtensions.cs | 17 +++++++++++++ src/Orchard.Web/Core/Navigation/Migrations.cs | 14 +++++------ src/Orchard.Web/Core/Orchard.Core.csproj | 1 + .../Orchard.Azure.MediaServices/Migrations.cs | 2 +- .../Modules/Orchard.Blogs/Migrations.cs | 6 ++--- .../Modules/Orchard.Comments/Migrations.cs | 4 ++-- .../Orchard.ContentPicker/Migrations.cs | 2 +- .../Modules/Orchard.CustomForms/Migrations.cs | 2 +- .../Modules/Orchard.Dashboards/Migrations.cs | 2 +- .../Orchard.DynamicForms/Migrations.cs | 2 +- .../Modules/Orchard.Layouts/Migrations.cs | 8 +++---- .../Orchard.MediaLibrary/Migrations.cs | 24 +++++++++---------- .../Orchard.MediaProcessing/Migrations.cs | 2 +- .../Modules/Orchard.Projections/Migrations.cs | 6 ++--- .../Modules/Orchard.Search/Migrations.cs | 2 +- .../Orchard.Search/Orchard.Search.csproj | 4 ++++ .../Migrations/Migrations.cs | 2 +- .../Extensions/WidgetsMetaDataExtensions.cs | 4 ++-- .../Modules/Orchard.Widgets/Migrations.cs | 2 +- 19 files changed, 64 insertions(+), 42 deletions(-) create mode 100644 src/Orchard.Web/Core/Common/Extensions/CommonMetaDataExtensions.cs diff --git a/src/Orchard.Web/Core/Common/Extensions/CommonMetaDataExtensions.cs b/src/Orchard.Web/Core/Common/Extensions/CommonMetaDataExtensions.cs new file mode 100644 index 000000000..e2239064a --- /dev/null +++ b/src/Orchard.Web/Core/Common/Extensions/CommonMetaDataExtensions.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Orchard.ContentManagement.MetaData.Builders; + +namespace Orchard.ContentManagement.MetaData { + public static class CommonMetaDataExtensions { + /// + /// Adds IdentityPart to the content type. + /// + /// The ContentTypeDefinitionBuilder object on which this method is called. + public static ContentTypeDefinitionBuilder WithIdentity(this ContentTypeDefinitionBuilder builder) { + return builder.WithPart("IdentityPart"); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Migrations.cs b/src/Orchard.Web/Core/Navigation/Migrations.cs index 48f891805..861c11004 100644 --- a/src/Orchard.Web/Core/Navigation/Migrations.cs +++ b/src/Orchard.Web/Core/Navigation/Migrations.cs @@ -20,7 +20,7 @@ namespace Orchard.Core.Navigation { ContentDefinitionManager.AlterTypeDefinition("MenuItem", cfg => cfg .WithPart("MenuPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("CommonPart") .DisplayedAs("Custom Link") .WithSetting("Description", "Represents a simple custom link with a text and an url.") @@ -34,7 +34,7 @@ namespace Orchard.Core.Navigation { ContentDefinitionManager.AlterTypeDefinition("MenuWidget", cfg => cfg .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("WidgetPart") .WithPart("MenuWidgetPart") .WithSetting("Stereotype", "Widget") @@ -52,7 +52,7 @@ namespace Orchard.Core.Navigation { .WithPart("MenuPart") .WithPart("BodyPart") .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .DisplayedAs("Html Menu Item") .WithSetting("Description", "Renders some custom HTML in the menu.") .WithSetting("BodyPartSettings.FlavorDefault", "html") @@ -92,7 +92,7 @@ namespace Orchard.Core.Navigation { ContentDefinitionManager.AlterTypeDefinition("MenuItem", cfg => cfg .WithPart("MenuPart") .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .DisplayedAs("Custom Link") .WithSetting("Description", "Represents a simple custom link with a text and an url.") .WithSetting("Stereotype", "MenuItem") // because we declare a new stereotype, the Shape MenuItem_Edit is needed @@ -115,7 +115,7 @@ namespace Orchard.Core.Navigation { ContentDefinitionManager.AlterTypeDefinition("MenuWidget", cfg => cfg .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("WidgetPart") .WithPart("MenuWidgetPart") .WithSetting("Stereotype", "Widget") @@ -130,7 +130,7 @@ namespace Orchard.Core.Navigation { .WithPart("MenuPart") .WithPart("BodyPart") .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .DisplayedAs("Html Menu Item") .WithSetting("Description", "Renders some custom HTML in the menu.") .WithSetting("BodyPartSettings.FlavorDefault", "html") @@ -172,7 +172,7 @@ namespace Orchard.Core.Navigation { public int UpdateFrom5() { ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg - .WithPart("IdentityPart") + .WithIdentity() ); return 6; diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index 36cbc19b0..00d6532fb 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -77,6 +77,7 @@ + diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Migrations.cs index 97580b798..57067be36 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Migrations.cs @@ -66,7 +66,7 @@ namespace Orchard.Azure.MediaServices { ContentDefinitionManager.AlterTypeDefinition("CloudVideo", type => type .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("MediaPart") .WithPart("TitlePart") .WithPart("PublishLaterPart") diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs index e4b00a464..60e0fcb54 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs @@ -80,7 +80,7 @@ namespace Orchard.Blogs { .WithPart("CommonPart") .WithPart("WidgetPart") .WithSetting("Stereotype", "Widget") - .WithPart("IdentityPart") + .WithIdentity() ); return 7; @@ -134,12 +134,12 @@ namespace Orchard.Blogs { public int UpdateFrom6() { ContentDefinitionManager.AlterTypeDefinition("RecentBlogPosts", cfg => cfg - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("BlogArchives", cfg => cfg - .WithPart("IdentityPart") + .WithIdentity() ); return 7; diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Comments/Migrations.cs index 379c77d2c..9d6de0ece 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Comments/Migrations.cs @@ -56,7 +56,7 @@ namespace Orchard.Comments { p => p .WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false") .WithSetting("DateEditorSettings.ShowDateEditor", "false")) - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("Blog", @@ -82,7 +82,7 @@ namespace Orchard.Comments { } public int UpdateFrom1() { - ContentDefinitionManager.AlterTypeDefinition("Comment", cfg => cfg.WithPart("IdentityPart")); + ContentDefinitionManager.AlterTypeDefinition("Comment", cfg => cfg.WithIdentity()); return 2; } diff --git a/src/Orchard.Web/Modules/Orchard.ContentPicker/Migrations.cs b/src/Orchard.Web/Modules/Orchard.ContentPicker/Migrations.cs index 405fcc978..91b73fabb 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPicker/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.ContentPicker/Migrations.cs @@ -16,7 +16,7 @@ namespace Orchard.ContentPicker { ContentDefinitionManager.AlterTypeDefinition("ContentMenuItem", cfg => cfg .WithPart("MenuPart") .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("ContentMenuItemPart") .DisplayedAs("Content Menu Item") .WithSetting("Description", "Adds a Content Item to the menu.") diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Migrations.cs b/src/Orchard.Web/Modules/Orchard.CustomForms/Migrations.cs index f3d75d9c1..dad45d608 100644 --- a/src/Orchard.Web/Modules/Orchard.CustomForms/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Migrations.cs @@ -37,7 +37,7 @@ namespace Orchard.CustomForms { cfg => cfg .WithPart("WidgetPart") .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("CustomFormPart") .WithSetting("Stereotype", "Widget") ); diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Dashboards/Migrations.cs index 97bf38c37..7ce3a0711 100644 --- a/src/Orchard.Web/Modules/Orchard.Dashboards/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Migrations.cs @@ -7,7 +7,7 @@ namespace Orchard.Dashboards { public int Create() { ContentDefinitionManager.AlterTypeDefinition("Dashboard", type => type .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("TitlePart") .WithPart("LayoutPart", p => p .WithSetting("LayoutTypePartSettings.DefaultLayoutData", DefaultDashboardSelector.DefaultLayout))); diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Migrations.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Migrations.cs index cc20cd75a..03a434b58 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Migrations.cs @@ -108,7 +108,7 @@ namespace Orchard.DynamicForms { public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("FormWidget", type => type - .WithPart("IdentityPart")); + .WithIdentity()); return 3; } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs index 746120763..0261358fc 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs @@ -29,7 +29,7 @@ namespace Orchard.Layouts { .WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false") .WithSetting("DateEditorSettings.ShowDateEditor", "false")) .WithPart("TitlePart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("LayoutPart", p => p .WithSetting("LayoutTypePartSettings.IsTemplate", "True")) .DisplayedAs("Layout") @@ -39,7 +39,7 @@ namespace Orchard.Layouts { .WithPart("CommonPart", p => p .WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false") .WithSetting("DateEditorSettings.ShowDateEditor", "false")) - .WithPart("IdentityPart") + .WithIdentity() .WithPart("WidgetPart") .WithPart("LayoutPart") .WithSetting("Stereotype", "Widget") @@ -72,7 +72,7 @@ namespace Orchard.Layouts { public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("Layout", type => type - .WithPart("IdentityPart")); + .WithIdentity()); return 3; } @@ -83,7 +83,7 @@ namespace Orchard.Layouts { .WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false") .WithSetting("DateEditorSettings.ShowDateEditor", "false")) .WithPart("WidgetPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("ElementWrapperPart", p => p .WithSetting("ElementWrapperPartSettings.ElementTypeName", elementTypeName)) .WithSetting("Stereotype", "Widget") diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Migrations.cs b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Migrations.cs index 8a6be0d4c..6591d036c 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Migrations.cs @@ -59,41 +59,41 @@ namespace Orchard.MediaLibrary { .DisplayedAs("Image") .WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", "True") .AsImage() - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("VectorImage", td => td .DisplayedAs("Vector Image") .WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", "True") .AsVectorImage() - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("Video", td => td .DisplayedAs("Video") .WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", "True") .AsVideo() - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("Audio", td => td .DisplayedAs("Audio") .WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", "True") .AsAudio() - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("Document", td => td .DisplayedAs("Document") .WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", "True") .AsDocument() - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("OEmbed", td => td .DisplayedAs("External Media") .WithSetting("Stereotype", "Media") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("CommonPart") .WithPart("MediaPart") .WithPart("OEmbedPart") @@ -105,23 +105,23 @@ namespace Orchard.MediaLibrary { public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("Image", td => td - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("Video", td => td - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("Audio", td => td - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("Document", td => td - .WithPart("IdentityPart") + .WithIdentity() ); ContentDefinitionManager.AlterTypeDefinition("OEmbed", td => td - .WithPart("IdentityPart") + .WithIdentity() ); return 3; @@ -200,7 +200,7 @@ namespace Orchard.MediaLibrary { .DisplayedAs("Vector Image") .WithSetting("Stereotype", "Media") .WithSetting("MediaFileNameEditorSettings.ShowFileNameEditor", "True") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("CommonPart") .WithPart("MediaPart") .WithPart("VectorImagePart") diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Migrations.cs b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Migrations.cs index 242c96023..0123d5a0e 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Migrations.cs @@ -14,7 +14,7 @@ namespace Orchard.MediaProcessing { cfg => cfg .WithPart("ImageProfilePart") .WithPart("CommonPart", p => p.WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false")) - .WithPart("IdentityPart") + .WithIdentity() ); SchemaBuilder.CreateTable("FilterRecord", diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs index 1f721e147..149e87667 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs @@ -64,7 +64,7 @@ namespace Orchard.Projections { cfg => cfg .WithPart("QueryPart") .WithPart("TitlePart") - .WithPart("IdentityPart") + .WithIdentity() ); SchemaBuilder.CreateTable("QueryPartRecord", @@ -179,7 +179,7 @@ namespace Orchard.Projections { cfg => cfg .WithPart("WidgetPart") .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("ProjectionPart") .WithSetting("Stereotype", "Widget") ); @@ -277,7 +277,7 @@ namespace Orchard.Projections { public int UpdateFrom3() { ContentDefinitionManager.AlterTypeDefinition("NavigationQueryMenuItem", cfg => cfg - .WithPart("IdentityPart") + .WithIdentity() ); return 4; diff --git a/src/Orchard.Web/Modules/Orchard.Search/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Search/Migrations.cs index abd815677..a680469c0 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Search/Migrations.cs @@ -27,7 +27,7 @@ namespace Orchard.Search { public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("SearchForm", - cfg => cfg.WithPart("IdentityPart")); + cfg => cfg.WithIdentity()); return 3; } diff --git a/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj b/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj index 17359f424..8f4fd6e37 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj +++ b/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj @@ -101,6 +101,10 @@ Orchard.Framework false + + {9916839c-39fc-4ceb-a5af-89ca7e87119f} + Orchard.Core + {73a7688a-5bd3-4f7e-adfa-ce36c5a10e3b} Orchard.MediaLibrary diff --git a/src/Orchard.Web/Modules/Orchard.Templates/Migrations/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Templates/Migrations/Migrations.cs index 4b68c649d..87668afd1 100644 --- a/src/Orchard.Web/Modules/Orchard.Templates/Migrations/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Templates/Migrations/Migrations.cs @@ -12,7 +12,7 @@ namespace Orchard.Templates { ContentDefinitionManager.AlterTypeDefinition("Template", type => type .WithPart("CommonPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("TitlePart") .WithPart("ShapePart") .Draftable()); diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Extensions/WidgetsMetaDataExtensions.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Extensions/WidgetsMetaDataExtensions.cs index e043ec465..ffa6b4294 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Extensions/WidgetsMetaDataExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Extensions/WidgetsMetaDataExtensions.cs @@ -25,8 +25,8 @@ namespace Orchard.ContentManagement.MetaData { return builder .WithPart("CommonPart") .WithPart("WidgetPart") - .WithPart("IdentityPart") - .WithSetting("Stereotype", "Widget"); + .WithSetting("Stereotype", "Widget") + .WithIdentity(); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs index c1f2b91b0..fbfedb3ba 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs @@ -44,7 +44,7 @@ namespace Orchard.Widgets { } public int UpdateFrom1() { - ContentDefinitionManager.AlterTypeDefinition("HtmlWidget", cfg => cfg.WithPart("IdentityPart")); + ContentDefinitionManager.AlterTypeDefinition("HtmlWidget", cfg => cfg.WithIdentity()); return 2; } From e04b020132a70475accffbf5ed6c77140ec98a48 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Mon, 4 Jan 2016 19:16:48 +0100 Subject: [PATCH 8/8] Add missing IdentityPart (needed for export/import) to ContainerWidget --- src/Orchard.Web/Core/Containers/Migrations.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Core/Containers/Migrations.cs b/src/Orchard.Web/Core/Containers/Migrations.cs index 7c8ee0577..d159c2a68 100644 --- a/src/Orchard.Web/Core/Containers/Migrations.cs +++ b/src/Orchard.Web/Core/Containers/Migrations.cs @@ -38,6 +38,7 @@ namespace Orchard.Core.Containers { .WithPart("CommonPart") .WithPart("WidgetPart") .WithPart("ContainerWidgetPart") + .WithIdentity() .WithSetting("Stereotype", "Widget")); ContentDefinitionManager.AlterPartDefinition("ContainerPart", part => part @@ -48,7 +49,7 @@ namespace Orchard.Core.Containers { .Attachable() .WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached.")); - return 6; + return 7; } public int UpdateFrom1() { @@ -123,5 +124,12 @@ namespace Orchard.Core.Containers { return 6; } + + public int UpdateFrom6() { + ContentDefinitionManager.AlterTypeDefinition("ContainerWidget", type => type + .WithIdentity()); + + return 7; + } } } \ No newline at end of file