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”
ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Indeed, on DEV the filesystem looks like this:
Whilst on PROD it looks like this:
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…
The problem was being cased by case-sensitivity. The code looked like this:
But the /views/persons/ directory was all lower case.
All corrected now.