diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js index 2d4e114dcf..76a3ec2913 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.controller.js @@ -1,4 +1,15 @@ -function textAreaController($rootScope, $scope, $log) { +function textAreaController($scope) { + + // macro parameter editor doesn't contains a config object, + // so we create a new one to hold any properties + if (!$scope.model.config) { + $scope.model.config = {}; + } + + if (!$scope.model.config.maxChars) { + $scope.model.config.maxChars = false; + } + $scope.model.maxlength = false; if($scope.model.config.maxChars) { $scope.model.maxlength = true; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js index 03f7510112..63dab278e4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js @@ -1,4 +1,15 @@ -function textboxController($rootScope, $scope, $log) { +function textboxController($scope) { + + // macro parameter editor doesn't contains a config object, + // so we create a new one to hold any properties + if (!$scope.model.config) { + $scope.model.config = {}; + } + + if (!$scope.model.config.maxChars) { + $scope.model.config.maxChars = false; + } + $scope.model.maxlength = false; if($scope.model.config.maxChars) { $scope.model.maxlength = true;