Skip to content

CFML: tag <cfinclude template="…"> creates no edge; included functions are not attached to the component (mixins) #2651

Open

Description

@HarryMuc

Summary

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 --->
<cfcomponent output="false">
	...
	<!--- shared parts of forms, lists and exports --->
	<cfinclude template="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

  1. An imports (or includes) edge for <cfinclude template="…">, the same as for the script form.
  2. 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.

Activity

  1. added 2 commits that reference this issue on Oct 23, 2026
    86db977
    d90f6ab
  2. colbymchenry commented on Oct 23, 2026

    @colbymchenry
    Owner

    Thanks for the report!

    #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions