So, I am first-time deploying a newly built app from my DEV server to a PROD environment.
Mostly all is working okay, but in one section, when I call the handler function, and it calls the view template <cfset event.setView(“Persons/persons”)> I get the following error:
“Could not find the included template //views/Persons/persons.cfm”
Note the double leading slash (!)
This doesn’t happen on my DEV server and all my other sections on PROD are working fine, using parallel coding, eg <cfset event.setView(“Organisations/organisations”)>
Does anyone know what might be causing this?
Are you by chance setting your app mapping to a forward slash or something? This sort of thing can happen when you have your app in a subfolder in development, but it’s in the root of the site on production and you had code to the tune of
“/” & variableThatIsNotEmptyNowButWillBeEmptyStringOnProd & “/path/etc”
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
Hi Brad
Indeed, on DEV the filesystem looks like this:
wwwroot
—Coldbox
—MyApp
Whilst on PROD it looks like this:
MyApp
—Coldbox
My Application.cfc settings are:
// COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );
// The web server mapping to this application. Used for remote purposes or static purposes
COLDBOX_APP_MAPPING = “”;
// COLDBOX PROPERTIES
COLDBOX_CONFIG_FILE = “”;
// COLDBOX APPLICATION KEY OVERRIDE
COLDBOX_APP_KEY = “”;
and nowhere that I can see am I adding an extra slash anywhere.
Can you see where the problem might lie?
Also, what’s puzzling is that the problem only appears for one handler - all the other handlers, using identical coding style, work fine…
Solved!
The problem was being cased by case-sensitivity. The code looked like this:
<cfset event.setView(“Persons/person”)>
But the /views/persons/ directory was all lower case.
All corrected now.