Is there a best practice for including modules that are also dependencies of other install modules? for example my project has the ORM module which has the validation module as a dependency. Should I be extending coldbox.modules.cborm.modules.cbvalidation.models.validators.IValidator for my custom validators or should I install validation at the root of the modules and extend it instead?
Neither. You should be able to use the “/cbvalidation” CF mapping automatically registered by ColdBox that points to the module. That way you don’t care where the actual physical files live.
Thanks!
~Brad
ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
If I am understanding you correctly I should not have to manually map the validation module. However when I remove my manually added cbvalidation mapping from the application cfc I get the following error in my custom validators after restarting the Adobe CF 11 service
The cbvalidation.models.validators.IValidator ColdFusion component or interface name, used to extend or implement the NavigationPortal.validators.medication.Repeat component is invalid. Ensure that the file exists, that the name does not start or end with a period (.), and the name is not an empty string.
My custom validator implements the IValidator class but it does not seem to know about the cbvalidation mapping
component accessors=“true” implements=“cbvalidation.models.validators.IValidator” singleton {
Does the validation module have a setting for the CF mapping. Coldbox doesn’t do it by default.
Also, what’s the stack trace? is the mapping being used before the modules are loaded?
Thanks!
~Brad
ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com