diff --git a/app/controllers/controller.js b/app/controllers/controller.js index 226a3cc..bf98dbe 100644 --- a/app/controllers/controller.js +++ b/app/controllers/controller.js @@ -558,13 +558,18 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc return $scope.activeSubmitWatcher; } $scope.submitWatcherOnSubmit = function (args) { - _.each($scope.model.value.fieldsets, function(fieldset) { + $scope.$broadcast("archetypeFormSubmitting", args); + } + + // we need to hook into this event to save the custom fieldset properties because the lazy loading + // of property editors means that the submitWatcherOnSubmit won't necessarily be fired + $scope.$on("formSubmitting", function(ev, args) { + _.each($scope.model.value.fieldsets, function (fieldset) { // extract the publish configuration from the fieldsets (and convert local datetimes to UTC) fieldset.releaseDate = toUtc(fieldset.releaseDateModel.value); fieldset.expireDate = toUtc(fieldset.expireDateModel.value); }); - $scope.$broadcast("archetypeFormSubmitting", args); - } + }); function toUtc(date) { if (!date) {