diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js index db9e05dc22..10bb81b4d4 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js @@ -147,7 +147,7 @@ function contentEditingHelper($location, $routeParams, notificationsService, ser this.handleValidationErrors(args.allNewProps, args.err.data.ModelState); - if (!this.redirectToCreatedContent(args.err.data.id, args.err.data.ModelState)) { + if (!args.redirectOnFailure || !this.redirectToCreatedContent(args.err.data.id, args.err.data.ModelState)) { //we are not redirecting because this is not new content, it is existing content. In this case // we need to detect what properties have changed and re-bind them with the server data. Then we need // to re-bind any server validation errors after the digest takes place. @@ -204,7 +204,7 @@ function contentEditingHelper($location, $routeParams, notificationsService, ser } args.scope.$broadcast("saved", { scope: args.scope }); - if (!this.redirectToCreatedContent(args.scope.content.id)) { + if (!this.redirectToCreatedContent(args.newContent.id)) { //we are not redirecting because this is not new content, it is existing content. In this case // we need to detect what properties have changed and re-bind them with the server data. diff --git a/src/Umbraco.Web.UI.Client/src/common/services/menuactions.service.js b/src/Umbraco.Web.UI.Client/src/common/services/menuactions.service.js index 583678b86f..28bc971096 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/menuactions.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/menuactions.service.js @@ -8,7 +8,7 @@ * @description * Defines the methods that are called when menu items declare only an action to execute */ -function umbracoMenuActions($q, treeService, $location) { +function umbracoMenuActions($q, treeService, $location, navigationService) { return { @@ -41,9 +41,13 @@ function umbracoMenuActions($q, treeService, $location) { * @param {object} args.section The current section */ "CreateChildEntity": function (args) { + + navigationService.hideNavigation(); + var route = "/" + args.section + "/" + treeService.getTreeAlias(args.treeNode) + "/edit/" + args.treeNode.id; //change to new path $location.path(route).search({ create: true }); + } }; } diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js index 7e290796dc..1c15c89b08 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js @@ -73,6 +73,7 @@ function ContentEditController($scope, $routeParams, $location, contentResource, contentEditingHelper.handleSaveError({ err: err, + redirectOnFailure: true, allNewProps: allNewProps, allOrigProps: contentEditingHelper.getAllProps($scope.content), rebindCallback: contentEditingHelper.reBindChangedProperties(allOrigProps, allNewProps) diff --git a/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js index a6ac7b319e..206f4c4a50 100644 --- a/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js @@ -8,22 +8,7 @@ */ function DataTypeEditController($scope, $routeParams, $location, dataTypeResource, notificationsService, angularHelper, serverValidationManager, contentEditingHelper) { - //set up the standard data type props - function createDisplayProps() { - $scope.properties = { - selectedEditor: { - alias: "selectedEditor", - description: "Select a property editor", - label: "Property editor" - }, - selectedEditorId: { - alias: "selectedEditorId", - label: "Property editor GUID" - } - }; - } - - //setup the pre-values as props + //method used to configure the pre-values when we retreive them from the server function createPreValueProps(preVals) { $scope.preValues = []; for (var i = 0; i < preVals.length; i++) { @@ -38,6 +23,22 @@ function DataTypeEditController($scope, $routeParams, $location, dataTypeResourc } } + //set up the standard data type props + $scope.properties = { + selectedEditor: { + alias: "selectedEditor", + description: "Select a property editor", + label: "Property editor" + }, + selectedEditorId: { + alias: "selectedEditorId", + label: "Property editor GUID" + } + }; + + //setup the pre-values as props + $scope.preValues = []; + if ($routeParams.create) { //we are creating so get an empty content item dataTypeResource.getScaffold($routeParams.id, $routeParams.doctype) @@ -45,7 +46,6 @@ function DataTypeEditController($scope, $routeParams, $location, dataTypeResourc $scope.loaded = true; $scope.preValuesLoaded = true; $scope.content = data; - createDisplayProps(); }); } else { @@ -55,7 +55,6 @@ function DataTypeEditController($scope, $routeParams, $location, dataTypeResourc $scope.loaded = true; $scope.preValuesLoaded = true; $scope.content = data; - createDisplayProps(); createPreValueProps($scope.content.preValues); //in one particular special case, after we've created a new item we redirect back to the edit diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js index 088d0ee4a5..18ccc0aaf9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js @@ -71,6 +71,7 @@ function mediaEditController($scope, $routeParams, mediaResource, notificationsS contentEditingHelper.handleSaveError({ err: err, + redirectOnFailure: true, allNewProps: allNewProps, allOrigProps: contentEditingHelper.getAllProps($scope.content), rebindCallback: contentEditingHelper.reBindChangedProperties(allOrigProps, allNewProps) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/requiredfield.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/requiredfield.html index 5012926855..14c06d29d6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/requiredfield.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/requiredfield.html @@ -1,7 +1,8 @@