Skip to content

Commit 7ee1e38

Browse files
authored
Merge pull request #29 from angel-chrystian/master
UDFValidator added rejectedValue to newError arguments
2 parents ad43c60 + 1122258 commit 7ee1e38

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.module.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
project.name=cbvalidation
2-
project.version=1.3.1
2+
project.version=1.4.0
33
module.name=cbvalidation

modules/cbvalidation/models/Mixins.cfm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function validateModel(
1616
string fields="*",
1717
any constraints,
1818
string locale="",
19-
string excludeFields=""
19+
string excludeFields="",
2020
string includeFields=""
2121
){
2222
return getValidationManager().validate( argumentCollection=arguments );
@@ -29,4 +29,4 @@ function getValidationManager(){
2929
return wirebox.getInstance( "ValidationManager@cbvalidation" );
3030
}
3131
32-
</cfscript>
32+
</cfscript>

modules/cbvalidation/models/ValidationManager.cfc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ component accessors="true" serialize="false" implements="IValidationManager" sin
172172
// had to use nasty evaluate until adobe cf get's their act together on invoke.
173173
getValidator( validatorType=key, validationData=arguments.rules[ key ] )
174174
.validate(
175-
validationResult = results,
176-
target = arguments.target,
177-
field = arguments.field,
178-
targetValue = evaluate( "arguments.target.get#arguments.field#()" ),
179-
validationData = arguments.rules[ key ]
175+
validationResult = results,
176+
target = arguments.target,
177+
field = arguments.field,
178+
targetValue = invoke( arguments.target, "get" & arguments.field ),
179+
validationData = arguments.rules[ key ]
180180
);
181181

182182
}
@@ -311,4 +311,4 @@ component accessors="true" serialize="false" implements="IValidationManager" sin
311311
return {};
312312
}
313313

314-
}
314+
}

modules/cbvalidation/models/validators/UDFValidator.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ component accessors="true" implements="cbvalidation.models.validators.IValidator
2828
return true;
2929
}
3030

31-
var args = {message="The '#arguments.field#' value does not validate",field=arguments.field,validationType=getName(),validationData=arguments.validationData};
31+
var args = {message="The '#arguments.field#' value does not validate",field=arguments.field,validationType=getName(),rejectedValue=( isSimpleValue( arguments.targetValue ) ? arguments.targetValue : '' ),validationData=arguments.validationData};
3232
validationResult.addError( validationResult.newError(argumentCollection=args) );
3333
return false;
3434
}

0 commit comments

Comments
 (0)