Skip to main content
May 12, 2008
Question

Migrating to Application.cfc breaks cferror tags in CF7

  • May 12, 2008
  • 1 reply
  • 325 views
Just found this issue, which doesn't seem to be well documented and may come up for people trying to migrate to Application.cfc.

Seems that a cferror tag in Application.cfc (placed in the CFC initialization code) searches for its template differently from the same cferror tag in Application.cfm.

In Application.cfm, cferror looks for the template in the top-level directory (where Application.cfm is), while the cfc version takes the directory of the executing page as its current directory.

I believe that cfinclude and cfmodule tags in Application.cfc initialization code still resolve their template references relative to that location (top-level), as they should.

Possible workarounds are to set up a CF Mapping (not my choice and not always an option), or to put a handler file of the same name in every directory of the application (probably just put the code in the top-level one, and cfinclude that from all the others). Or, of course, to migrate immediately to an onError handler.

Anyone know if this cferror behavior still exists in CF8?
This topic has been closed for replies.

1 reply

Inspiring
May 12, 2008
should use onError method instead of cferror tag in app.cfc ...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
May 12, 2008
quote:

Originally posted by: Newsgroup User
should use onError method instead of cferror tag in app.cfc ...



Sure, but they're supporting cferror too, presumably to help transition more easily. So then why change the behavior?