With Coldbox 4.0 I am getting the following validation error
invalid call of the function processRules(xxxxxx\modules\cbvalidation\models\ValidationManager.cfc), first Argument (results) is of invalid type, can’t cast Object type [Component cbvalidation.models.result.ValidationResult] to a value of type [cbvalidation.models.result.ivalidationresult]
this is happening when I invoke populateModel(entity) with a new orm entity of a type that extends cborm.models.ActiveEntity
Ah ok. Is that not something that is created inside the validation module and returned to me?, I am not doing anything complex.
I have a CFC ORM entity, User. It extends cborm.models.ActiveEntity, has a constraints structure.
I then have a handler which is running the code I listed above, simply created a new User and passing it into validateModel
var user= populateModel( entityNew(“User”) );
prc.validationResults = validateModel( user);
The second line creates the error, with it generating inside \modules\cbvalidation\models\ValidationManager.cfc at line 129, when the processRules method invokes
I was expecting that it would just return me an array of errors into my prc.validationResults object
That’s interesting. I wonder if there’s a regression from Railo to Lucee. I would recommend starting a thread over on the Lucee list with a simple example and ask about it.