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:
@@ -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" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, appS
|
||||
});
|
||||
}
|
||||
else {
|
||||
$scope.busy = false;
|
||||
deferred.reject();
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,8 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, navi
|
||||
editorState.set($scope.content);
|
||||
$scope.busy = false;
|
||||
});
|
||||
}else{
|
||||
$scope.busy = false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -121,6 +121,8 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
|
||||
editorState.set($scope.content);
|
||||
$scope.busy = false;
|
||||
});
|
||||
}else{
|
||||
$scope.busy = false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user