tracker issue : CF-3137187

select a category, or use search below
(searches all categories and all time range)
Title:

onMissingTemplate doesn't fire when you cfinclude a template that doesn't exist

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): David McGuigan / David McGuigan (David McGuigan)

Created: 03/13/2012

Components: Language

Versions: 10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Public Beta /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Win All

Vote Count: 1

<cfinclude template="butter.cfm" /> 

Throws the following error:

Could not find the included template butter.cfm. Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator...

Technically that's a request for a cfm template that doesn't exist, and it would be great if it fired off the application-level onMissingTemplate event which is arguably an expected behavior. Thanks. 

Thread: https://prerelease.adobe.com/project/forum/thread.html?cap=312e16f64a924954a37d2c59405cd5d7&forid={be45a6ae-bb99-44f8-aa07-4642b1f1907f}&topid={4a5415de-7cf9-4e3a-833c-288c4054525f}&tp=1&to=asc&ts=last&tl=15&tv=desc#{049FBB68-4E75-4D65-8010-B112BAFFE3BC}

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3137187

External Customer Info:
External Company:  
External Customer Name: David Michael McGuigan
External Customer Email:

Attachments:

Comments:

I agree that the onMissingTemplate method should fire if a template is called bad does not exist. Much like onMissingMethod works.
Vote by External U.
20103 | March 13, 2012 08:58:43 PM GMT
The idea behind introducing onMissingTemplate was to give control to the developer/application what needs to be shown when an external request (AJAX, HTTP etc) hits the server and URL resource could not be located. Site Wite handler also achieves the same but then its server wide and not application wide. When using cfinclude anyway developer is inside CF application, he have many ways to validate and check the template being included exists or not. So I don’t see any strong reason why onmissingtemplate should handle cfinclude templates too.
Comment by Rupesh K.
20102 | March 14, 2012 02:22:26 AM GMT