diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 67bb5a64a5..f7704ab870 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -55,9 +55,9 @@ } } - + // if we still dont have a app, lets show the first one: - if (isAppPresent === false) { + if (isAppPresent === false && content.apps.length) { content.apps[0].active = true; $scope.appChanged(content.apps[0]); } diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js index 3f67b74380..a4dac046e5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js @@ -198,9 +198,11 @@ return a.alias === "umbContent"; }); - //The view model for the content app is simply the index of the variant being edited - var variantIndex = vm.content.variants.indexOf(variant); - contentApp.viewModel = variantIndex; + if (contentApp) { + //The view model for the content app is simply the index of the variant being edited + var variantIndex = vm.content.variants.indexOf(variant); + contentApp.viewModel = variantIndex; + } // make sure the same app it set to active in the new variant if(activeAppAlias) { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html index 94fb7edae8..9cd245b0d5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html @@ -5,7 +5,7 @@
- + - +
+ + + + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.controller.js index 3140af9d6c..59351ffd38 100644 --- a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.controller.js @@ -25,7 +25,11 @@ function ContentBlueprintEditController($scope, $routeParams, contentResource) { var contentApp = _.find(content.apps, function (app) { return app.alias === "umbContent"; }); - content.apps = [contentApp]; + if (contentApp) { + content.apps = [contentApp]; + } else { + content.apps = []; + } } content.allowPreview = false; content.allowedActions = ["A", "S", "C"]; diff --git a/src/Umbraco.Web/ContentApps/ContentEditorContentAppFactory.cs b/src/Umbraco.Web/ContentApps/ContentEditorContentAppFactory.cs index da7dbee364..ea2dc1b2d6 100644 --- a/src/Umbraco.Web/ContentApps/ContentEditorContentAppFactory.cs +++ b/src/Umbraco.Web/ContentApps/ContentEditorContentAppFactory.cs @@ -18,7 +18,7 @@ namespace Umbraco.Web.ContentApps { switch (o) { - case IContent _: + case IContent content when content.Properties.Count > 0: return _contentApp ?? (_contentApp = new ContentApp { Alias = "umbContent", @@ -28,6 +28,9 @@ namespace Umbraco.Web.ContentApps Weight = Weight }); + case IContent _: + return null; + case IMedia media when !media.ContentType.IsContainer || media.Properties.Count > 0: return _mediaApp ?? (_mediaApp = new ContentApp {