coldfusioncoldfusion-11application.cfc

cfinclude paths will not recursively resolve in Application.cfc?


This is CF11.

I have a collection of dependencies that I must cfinclude at the top of every CFM and CFC we run. It is a single cfinclude that recursively includes other files. This has worked on every page load for many years; mostly legacy CFM pages, and some newer CFCs. However, I've recently tried to do this from within an Application.cfc, and while it resolves the top-most include, it fails to resolve the children includes. I get the typical cfinclude relative-path error message:

... 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. Or, you can use 
per-application settings to specify mappings specific to this application by specifying a mappings 
struct to THIS.mappings in Application.cfc. ...

From the CFC itself (called from the browser with URL x/index.cfm), I have:

getBaseTemplatePath() = x/index.cfm
getCurrentTemplatePath() = x/Application.cfc
expandPath("./") = x

And from the top-most include:

getBaseTemplatePath() = x/index.cfm
getCurrentTemplatePath() = y/TheInclude.cfm
expandPath("./") = x

Other CFCs in this application - those siblings of Application.cfc that cfinclude the same file - produce the same path expansions, but also successfully resolve the child includes. Am I doing something wrong, is this a bug in Application.cfc, or ...?


Solution

  • This is a bug and has been verified by Adobe.

    Bug report CF-4207025.