The major compatibility issues will be covered as well as how to smoothly upgrade to this release from previous ColdBox versions. You can also check out the What's New guide to give you a full overview of the changes.
event.getCurrentHandler() returns different resultsIn ColdBox 4, calling getCurrentHandler() would return the module if it existed:
In ColdBox 5, we correctly remove the module name so it can be retrieved via getCurrentModule() instead.
setNextEvent() deprecated in favor of relocate()The setNextEvent() method has been renamed to relocate() to better adjust to modern times. This deprecation will be removed in future versions of ColdBox.
The modules autoReload flag has been deprecated. This causes more headaches than anything. If you want changes reflected, reinit the framework.
onInvalidEvent renamed to invalidEventHandlerThe ColdBox construct setting onInvalidEvent has been renamed now to invalidEventHandler. This will be removed in future versions of ColdBox.
setAutoReload() RemovedThe setAutoReload() flag in the SES interceptor has been removed. It is evil I tell you. If you want your routing to be re-read, then reinit the framework.
The buildLink() method had the argument linkTo to denote the event or route to link to. This was verbose, so we shortened it to to:
Railo support dropped. Any classes that started with the word Railo need to be changed to Lucee especially on the CacheBox providers.
ColdFusion 9-10 support has been dropped. Adobe doesn't support them anymore, so neither do we.
The datasources configuration setting directive has been dropped in favor of just leveraging the settings directive. Just move your datasource metadata into the settings struct and reference it using the settings DSL.
Previous
New
The WireBox interface: coldbox.system.ioc.dsl.IDSLBuilder has changed in ColdBox 5, so if you are implementing your own DSLs, then you must update it like so:
In ColdBox 5 we removed the output attribute:
The string buffer has been updated in order to become thread safe and there are several methods that have been deprecated. Instead of using appendToBuffer() you need to use the buffer argument.
Previous
New
module:handlerhandler<!-- Before -->
<a href="#event.buildLink( linkTo="/about/us" )#">About Us</a>
<!-- After -->
<a href="#event.buildLink( to="/about/us" )#">About Us</a>// Datasource definitions
datasources = {
mydsn = {
type = "mysql",
username = "luis",
name = "mydsn"
}
}// Injections
property name="dsn" inject="coldbox:datasource:mydsn"// Settings
settings = {
mydsn = {
type = "mysql",
username = "luis",
name = "mydsn"
}
}// Injections
property name="dsn" inject="coldbox:setting:mydsn"public any function init( required any injector ) output="false"{
public any function process( required definition, targetObject ) output="false"{public any function init( required any injector ) {
public any function process( required definition, targetObject ) {appendToBuffer( generatedHTML );buffer.append( generatedHTML );