Opened 5 years ago
Closed 4 years ago
#18800 closed defect (invalid)
Метод validate.check() всеп поля помечает как Invalid
Reported by: | victorynox | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.13 |
Component: | Dojox | Version: | 1.10.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Метод validate.check() все поля помечает как Invalid. Так как во время проверки корректности поля ожидается объект constraintResponse с полями isValid(bool), message(string), а методы проверки (validate.isText и подобные) возвращают true или false, в итоге проверяется constraintResponse.isValid который в свою очередь на самом деле является не объектом, а bool переменной
var constraintResponse; // case 1: constraint value is validation function if(lang.isFunction(profile.constraints[name])){ constraintResponse = profile.constraints[name](elem.value); }else if(lang.isFunction(lang.getObject(name, false, profile.constraints))){ // case 2: constraint value is validation function name as string constraintResponse = lang.getObject(name, false, profile.constraints)(elem.value); }else if(lang.isArray(profile.constraints[name])){ // handle nested arrays for multiple constraints if(lang.isArray(profile.constraints[name][0])){ for(var i=0; i<profile.constraints[name].length; i++){ constraintResponse = validate.evaluateConstraint(profile, profile.constraints[name][i], name, elem); if(!constraintResponse.isValid){ break; } } }else{ // case 3: constraint value is array, first elem is function, // tail is parameters if(lang.isFunction(lang.getObject(name, false, profile.constraints))){ constraintResponse = validate.evaluateConstraint(profile, profile.constraints[profile.constraints[name]], name, elem); }else{ constraintResponse = validate.evaluateConstraint(profile, profile.constraints[name], name, elem); } } } // if constraintResponse is false (backwards compatibility with last version) or if property isValid is false, return the invalid field name and/or the constraintResponse message if(!constraintResponse){ invalid[invalid.length] = elem.name; }else if(!constraintResponse.isValid){ invalid[invalid.length] = { field : elem.name, message : constraintResponse.message
Change History (3)
comment:1 Changed 4 years ago by
Status: | new → pending |
---|
comment:2 Changed 4 years ago by
Milestone: | tbd → 1.13 |
---|
comment:3 Changed 4 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
Apologies, but we'll need the ticket report in English to be able to understand the issue at hand. Thanks for your consideration.