U4-8621 - Validation error won't re-validate

Created by seanhak 21 Jun 2016, 14:10:01 Updated by Andy Butland 11 Aug 2016, 13:21:51

'''What did you do?''' Named a tab the same as a existing name. Got an error you can't use duplicate names for tabs.

'''What did you expect to happen?''' Once I changed I expect it to validate and let me save.

'''What actually happened?''' Validation error never changed even though I tried to change to different names and leaving it blank. Only solution was to refresh and loose all properties I had setup.

Comments

Andy Butland 11 Aug 2016, 13:21:51

Had a little look into this. Couldn't solve but will post what I found in case it helps someone else to the solution.

There's already a watch on the model that should clear the server errors when the field is subsequently changed [here|https://github.com/umbraco/Umbraco-CMS/blob/8d5742acb76b0f0c2fa4ed188081e8d16c46c9bc/src/Umbraco.Web.UI.Client/src/common/directives/validation/valserverfield.directive.js#L26]. From what I [read|https://www.sitepoint.com/mastering-watch-angularjs/] that will only make reference checks on the object; to watch for changes to fields it needs the third parameter like this:

eventBindings.push(scope.$watch('ngModel', function(newValue){
    if (ctrl.$invalid) {
        ctrl.$setValidity('valServerField', true);
    }
}, true));

So thought that was an easy fix. But still doesn't work unfortunately.


Priority: Normal

Type: Bug

State: Submitted

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.5.0

Due in version:

Sprint:

Story Points:

Cycle: