I am not sure how this is happening, but I know it is something that I am doing I just can’t work out why I get this error message.
First a bit of a background to the solution that I am doing.
When a request comes in, I grab the event and try to find if the event exists and if it doesn’t then I change the event to go to a new event. For example the following URLS, when they come in and there is a common code base then I change to that event.
www.mydomain.com/application1/space
www.mydomain.com/application2/space
Now the way this works is I have handlers for default, and application1 so if the URL for application2 comes in then the event is changed to point to the default/space handler rather than the application2/handler. This works fine up to this point.
The problem arises when application2 has the following
www.mydomain.com/application2/space/spaceURL
I get the following error in the same code, that actually works if I don’t have the spaceURL. The code for this is as follows.
Could not find the included template /views/default/space/displayspace.cfm
var rc = event.getCollection();
var space = Event.getValue(‘spaceURL’,’’);
if(Event.getValue(‘spaceURL’,’’) != ‘’) {
//find space
//if found then display space
} else {
event.setView("/space/displayWelcome");
//display dashboard or welcome screen
}
So if I manually use event.setView() it works as described because the spaceURL is empty, but if it is not then there is no event set and it goes to the default view. But the error message doesn’t make sense, and this is because I have a new Render.cfc which extends the old one in the system core. The reason I do this is because I want the external views checked first, if it exists then it is loaded and if not then it goes back to the default views.
So my question is this, if I can override the Render.cfc why is it not used when the event.setView() is not used?