[ColdBox 4.0] Validation Module Help

Hi there,

I included the validation module, I tested to check if my coldbox platform it detected it… ok

But when I try to use validateModel() inside a module I get “validateModel” method does not exists.
Also, If I check my sharedConstrains, my module’s validation sharedConstrains configuration noes not appear or are not being detected.

Any ideas?

Thanks

Felipe Serrano

Xerrano,

Sorry, I can’t help yet. What is this validation module for?

the cbvalidation module in forgebox,

It seems that is not registering validateNodel() method, and also any custom module’s “sharedConstrains” are not being picked up by cbvalidation.

Thanks

Xerrano

Hello, Did you get it to work? I’m having similar issue. Worked fine in 3.8 but now says:

Type: ValidationManager.InvalidSharedConstraint
Messages: The shared constraint you requested (sharedUser) does not exist Valid constraints are:

The instructions file in the module says to have the sharedconstraints in coldbox.cfc as always but I did see moduleconfig.cfc which has a sharedconstraints structure stubbed out so I tried it there. Still getting same error.

Thanks.

Irv

I think this thread got overlooked. Can someone put in a ticket please and explain what’s not working. A code sample would be great too.

Thanks!

~Brad

will do. thanks.

Just sent the info to bugs@coldbox.org.

Has the location for validation structs moved? The file moduleconfig.cfc in the validation module has two spots:

function configure(){

// Mixin our own methods on handlers, interceptors and views via the ColdBox UDF Library File setting
arrayAppend( controller.getSetting( “ApplicationHelper” ), “#moduleMapping#/models/Mixins.cfm” );

// Validation Settings
settings = {
// Change if overriding
manager = this.COLDBOX_VALIDATION_MANAGER,
// Setup shared constraints below
sharedConstraints = { …

AND

private function parseParentSettings(){
/**
Sample:
validation = {
manager = “class path” // if overriding
sharedConstraints = {
name = {
field = { constraints here }
}
}

}
*/
// Read parent application config
var oConfig = controller.getSetting( “ColdBoxConfig” );
var validationDSL = oConfig.getPropertyMixin( “validation”, “variables”, structnew() );
var configStruct = controller.getConfigSettings();

// Default Config Structure
configStruct.validation = {
manager = this.COLDBOX_VALIDATION_MANAGER,
sharedConstraints = {…

I tried both of these in addition to the “normal” Coldbox.cfc location and didn’t get anywhere. In all cases I get

Type: ValidationManager.InvalidSharedConstraint
Messages: The shared constraint you requested (sharedUser) does not exist Valid constraints are:

In short nothing is getting picked up anywhere as the default config struct for constraints.

Thanks.

Thanks, this is verified and fix.

Please run the “update” command to update your dependencies.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

Perfect. Thank you!