Do custom tags in application.cfc ignore this.customTagPaths?

Inside my root, application.cfc

I define this.customTagPaths

. This has been tested to work on all pages, including subfolders. Inside one sub folder I have application.cfc

which extends this root application.cfc file. The pages in this folder are still using the correct custom tags, so we know this is working correctly.

However, when trying to use a custom tag inside the file itself, [subfolder]/application.cfc

I find it is being pulled from a different custom tag path. I have added some debugging information to the custom tag and it is output when the custom tag is called from a normal page, but not when called from application.cfc

. I don't have access to the server to fine-tune the debug information in other custom tags.

Is there any code to application.cfc

ignore this.customTagPaths

, and if so, how can I use the specific tag that I need? This custom tag sets a variable in the call scope, so it cannot be called with a simple one cfInclude

.

Edit

I'll try to address some issues in the comments here.

The custom tag in question has been simplified down to this code:

    <cfset Caller.groupList = ""> 
    <cfquery name="getGroups">
        SELECT id, name
        FROM groups
        WHERE id = 1
    </cfquery>

    <cfoutput query="getGroups">
        <cfset Caller.groupList = #ListAppend(Caller.groupList, name)#> 
    </cfoutput>
    <cfoutput>Caller.groupList: #Caller.groupList#<br></cfoutput>

      

Application.cfc uses this code:

    <cfcomponent extends="RootApplication">
            ............
            <cf_groupList>
            <cfoutput>request.groupList: #request.groupList#<br><br></cfoutput>
    </cfcomponent>

      

When cf_groupList is called directly from cfm, it writes "Call.groupList: xxxx" to the page and shows the correct values ​​from the dev database. However, when Application.cfc fires a custom tag, "Call.groupList: xxxx" never appears, but "request.groupList: xxxx" does, and in the latter case, it displays the list we expect from the current database. Both live and dev sites are currently on the same server, which we are in the process of changing, but at the moment I have no debug information.

The reason I am calling the custom tag from Application.cfc is because this tag is used in many other places. Simply copying and pasting the code into Application.cfc would have solved the problem, but then we have a duplicate code issue that we need to remember to update in two places in the future. Using a custom tag in application.cfc instead of duplicate code seemed right.

Mark, you're right. When placed in parent Application.cfc, the custom tag works correctly. This is not the case in a child.
+3


source to share





All Articles