Hi I'm getting an error loading modules (which used to work fine). To
check it wasn't anything I'd done, I used the ColdBox Builder plugin
to create a new module in my app and I still get:
An unhandled exception has occurred. Please look at the diagnostic
information below:
Type Expression
Message Element DEFAULTLAYOUT is undefined in a CFML structure
referenced as part of an expression.
Detail
Extended Info
Tag Context C:\xampp\htdocs\testapp\frameworks\coldbox-core\system\web
\context\RequestContext.cfc (223)
C:\xampp\htdocs\testapp\modules\foobar\handlers\Home.cfc (7)
C:\xampp\htdocs\testapp\frameworks\coldbox-core\system\web
\Controller.cfc (651)
C:\xampp\htdocs\testapp\frameworks\coldbox-core\system\web
\Controller.cfc (542)
C:\xampp\htdocs\testapp\frameworks\coldbox-core\system\Coldbox.cfc
(226)
C:\xampp\htdocs\testapp\Application.cfc (103)
I've got my application set up to use composition instead of
Application.cfc extending ColdBox.cfc. I got ColdBox directly from
github.
The config for the Module is (as generated):
<cfcomponent output="false" hint="My Module Configuration">
<cfscript>
/**
Module Directives as public properties
this.title = "Title of the module";
this.author = "Author of the module";
this.webURL = "Web URL for docs purposes";
this.description = "Module description";
this.version = "Module Version"
Optional Properties
this.viewParentLookup = (true) [boolean] (Optional) // If true,
checks for views in the parent first, then it the module.If false,
then modules first, then parent.
this.layoutParentLookup = (true) [boolean] (Optional) // If true,
checks for layouts in the parent first, then it the module.If false,
then modules first, then parent.
this.entryPoint = "" (Optional) // If set, this is the default
event (ex:forgebox:manager.index) or default route (/forgebox) the
framework
will use to create an entry link to the module.
Similar to a default event.
structures to create for configuration
- parentSettings : struct (will append and override parent)
- settings : struct
- datasources : struct (will append and override parent)
- webservices : struct (will append and override parent)
- interceptorSettings : struct of the following keys ATM
- customInterceptionPoints : string list of custom interception
points
- interceptors : array
- routes : array Allowed keys are same as the addRoute() method of the
SES interceptor.
- modelMappings : structure of model mappings. Allowed keys are the
alias and path, same as normal model mappings.
Available objects in variable scope
- controller
- appMapping (application mapping)
- moduleMapping (include,cf path)
- modulePath (absolute path)
- log (A pre-configured logBox logger object for this object)
Required Methods
- configure() : The method ColdBox calls to configure the module.
Optional Methods
- onLoad() : If found, it is fired once the module is fully loaded
- onUnload() : If found, it is fired once the module is unloaded
*/
// Module Properties
this.title = "foo";
this.author = "foo";
this.webURL = "http://";
this.description = "testing module error";
this.version = "1.0";
// If true, looks for views in the parent first, if not found, then
in the module. Else vice-versa
this.viewParentLookup = true;
// If true, looks for layouts in the parent first, if not found, then
in module. Else vice-versa
this.layoutParentLookup = true;
// Module Entry Point
this.entryPoint = "foobar:home.index";
function configure(){
// parent settings
parentSettings = {
};
// module settings - stored in modules.name.settings
settings = {
};
// datasources
datasources = {
};
// web services
webservices = {
};
// SES Routes
routes = [
//{pattern="/api-docs", handler="api",action="index"}
];
// Custom Declared Points
interceptorSettings = {
customInterceptionPoints = ""
};
// Custom Declared Interceptors
interceptors = [
];
}
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
}
/**
* Fired when the module is unregistered and unloaded
*/
function onUnload(){
}
</cfscript>
</cfcomponent>
The parent application runs fine, any thoughts appreciated.
Thanks,
- John