You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CFML: tag <cfinclude template="…"> creates no edge; included functions are not attached to the component (mixins) #2651
Script-style include "x.cfm"; produces an imports edge. The tag form does not.
Our project has 246<cfinclude template="…"> with a literal path, and none of them appears in the graph. All 9 imports edges in the index come from script includes.
Example
<!--- contens/core/baseform.cfc --->
<cfcomponentoutput="false">
...
<!--- shared parts of forms, lists and exports --->
<cfincludetemplate="formlistshared.cfm">
</cfcomponent>
formlistshared.cfm is indexed, and its functions (checkRightsPartPrepare, checkRightsPartRecords, …) appear as top-level function nodes.
There is no edge from baseform.cfc to formlistshared.cfm.
The functions are not members of baseform or its subclasses.
A component-level include is the common CFML mixin pattern: the included functions become methods of the including component and of every component that extends it.
Path styles seen (all literal)
Style
Count
relative to the current file (../x/y.cfm)
128
same directory (formlistshared.cfm)
67
mapping-rooted (/contenscms/..., depends on mapping support, see the dotted extends issue)
46
Expected
An imports (or includes) edge for <cfinclude template="…">, the same as for the script form.
When the include sits at component level (outside <cffunction>), the included file's functions count as members of the component. Calls such as this.checkRightsPartPrepare() or unqualified calls in subclasses then resolve.
#2838 is merged to main and covers the first part. <cfinclude template="…"> now links the component, function or template it sits in to the file it includes, as the script include already did. So do cfinclude(template="…"), include template="…"; and an include inside a function. Relative paths like ../shared/helpers.cfm resolve against the including file, so they find the right file even when another file has the same name. That ships in the next release.
Treating a component-level include's functions as members of the component and its subclasses (the mixin part) is a bigger change. We're leaving this issue open for it as a feature request. Mapping-rooted paths (/contenscms/…) depend on the mapping option discussed in #2650.
Activity
fix(cfml): <cfinclude template> and cfinclude() link the code to the …
fix(cfml): <cfinclude template> and cfinclude() link the code to the …
colbymchenry commentedon Oct 23, 2026
Thanks for the report!
#2838 is merged to
mainand covers the first part.<cfinclude template="…">now links the component, function or template it sits in to the file it includes, as the scriptincludealready did. So docfinclude(template="…"),include template="…";and anincludeinside a function. Relative paths like../shared/helpers.cfmresolve against the including file, so they find the right file even when another file has the same name. That ships in the next release.Treating a component-level include's functions as members of the component and its subclasses (the mixin part) is a bigger change. We're leaving this issue open for it as a feature request. Mapping-rooted paths (
/contenscms/…) depend on the mapping option discussed in #2650.