ColdBox Forums Notification: Post to Problems with Environment Interceptor

Title: RE: Problems with Environment Interceptor
Thread: Problems with Environment Interceptor
Forum: Need Help?
Conference: ColdBox
User: CraigHeneveld I believe there is a bug here.

The ENVIRONMENT local variable is never being
set. So when this line is called

SettingsArray = xmlSearch( oXML ,
"/environmentcontrol/environment[@name='#ENVIRONMENT#']/Setting");

Nothing
is stored in the Settings Array.

I changed this

for(i=1; i lte
ArrayLen(environmentsArray); i=i+1){
        if (
listFindNoCase(trim(environmentsArray[i].XMLAttributes.urls),cgi.http_host) ){
//Place the ENVIRONMENT on the settings structure.
setSetting("ENVIRONMENT", trim(environmentsArray[i].XMLAttributes.name));
break;
        }
      }

To

/* Detect the environment */
      for(i=1; i lte
ArrayLen(environmentsArray); i=i+1){
        if (
listFindNoCase(trim(environmentsArray[i].XMLAttributes.urls),cgi.http_host) ){
//Place the ENVIRONMENT on the settings structure.
setSetting("ENVIRONMENT", trim(environmentsArray[i].XMLAttributes.name));
ENVIRONMENT = trim(environmentsArray[i].XMLAttributes.name);
          break;
        }
}

Am I thinking correctly here?
http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=F36DB06A-FF65-CEF6-655DBCAAAAE9B918