• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Migrating to Application.cfc breaks cferror tags in CF7

Explorer ,
May 12, 2008 May 12, 2008

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

296

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 12, 2008 May 12, 2008

Copy link to clipboard

Copied

should use onError method instead of cferror tag in app.cfc ...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 12, 2008 May 12, 2008

Copy link to clipboard

Copied

LATEST
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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation