fixes: U4-3728 Non-Mandatory Numeric property gives error when left blank

also fixes dimming on buttons fails when validation fails
This commit is contained in:
perploug
2013-12-04 13:39:51 +01:00
parent db5b99dbf1
commit b6bcdcb351
5 changed files with 13 additions and 3 deletions

View File

@@ -12,10 +12,13 @@ namespace Umbraco.Core.PropertyEditors
{
public override IEnumerable<ValidationResult> Validate(object value, string config, PreValueCollection preValues, PropertyEditor editor)
{
var result = value.TryConvertTo<int>();
if (result.Success == false)
if (value != null && value.ToString() != string.Empty)
{
yield return new ValidationResult("The value " + value + " is not a valid integer", new[] {"value"});
var result = value.TryConvertTo<int>();
if (result.Success == false)
{
yield return new ValidationResult("The value " + value + " is not a valid integer", new[] { "value" });
}
}
}

View File

@@ -152,6 +152,7 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, appS
});
}
else {
$scope.busy = false;
deferred.reject();
}

View File

@@ -79,6 +79,8 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, navi
editorState.set($scope.content);
$scope.busy = false;
});
}else{
$scope.busy = false;
}
};

View File

@@ -121,6 +121,8 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
editorState.set($scope.content);
$scope.busy = false;
});
}else{
$scope.busy = false;
}
};

View File

@@ -112,6 +112,8 @@
<key alias="updateDate">Sidst redigeret</key>
<key alias="uploadClear">Fjern fil</key>
<key alias="urls">Link til dokument</key>
<key alias="childItems" version="7.0">Undersider</key>
</area>
<area alias="create">
<key alias="chooseNode">Hvor ønsker du at oprette den nye %0%</key>