As I was writing the prependArray function for my previous email regarding the feature request, I noticed a bug in the MessageBox plugin.
If you look at the appendArray method:
var currentMessage = "";
var newMessage = "";
// Do we have a message?
if( isEmpty() ){
// Set default message
setMessage(type=‘information’,messageArray=arguments.messageArray);
}
else{
// Get Current Message
currentMessage = getMessage();
// Append
ArrayPrePend(arguments.messageArray,currentMessage.message);
// Set it back
setMessage(type=currentMessage.type,messageArray=arguments.messageArray);
}
You will see that when there is no message, the message type is set to ‘information’ but the setMessage method will only accept ‘error’, ‘warning’, or ‘info’ as possible values:
// check message type
if( refindnocase("(error|warning|info)", trim(arguments.type)) ){
} else {
$throw(“The message type is invalid: #arguments.type#”,“Valid types are info,error or warning”,“MessageBox.InvalidMessageType”);
}
Also note here again that for the appendArray method, the ArrayPrePend function is used with the arguments in reversed order… Suggest for readability to use ArrayAppend instead with the arguments in the correct order.
Get a github account
Fork coldbox
Then setup a local dev for coldbox usin your fork
Make sure you work on the development branch
Do your changes
Commit and push to your repo
Via github do a send pull request
That’s it