![]() | |||||
![]() |
|||||
|
ColdFusion CFC Inheritance Bug
I've run into a strange bug with CFC inheritance. It definitely seems to be a problem in ColdFusion 8, and I would be interested to see if it's a problem in CF9 also, but I haven't started using CF9 yet. The problem comes up if you extend a CFC of the same name that is in a different directory. CFCs in different directories should be treated as completely different components, as far as I know, but something goes wrong if the file name is the same. For a simple test case, I created 3 CFCs: /test/Test1.cfc The first file is in a subdirectory, and the other two files are identical except for their names -- one of them is the same name as the first file, and the other one is different. I created a fourth file with the following code: <cfset CFC1 = CreateObject("component","test.Test1")> What would you expect this file to output? I would expect: Test Instead, I get:
Super Test In other words, even though /Test1.cfc overrides the Test function, it is ignored in favor of the function in /test/Test1.cfc. Test2.cfc, on the other hand, works correctly. My first question, of course, is: Have I missed something? This sure seems like a glaring bug to me. Update: Posted on January 25, 2010 8:33:18 PM EST by David Hammond CommentsTopics for this page: |
June 28, 2010 -- Modern Signal launches redeveloped website for National Health Policy Forum, a nonpartisan research and public policy organization at The George Washington University. The new site includes admin tools to manage email announcements, event invitations and RSVPs, surveys, and an extensive library of publications and meeting materials. The site also features a customized Google Search integration, and a new content management system was integrated within the existing design and information architecture of the site. -View-
April 22, 2010 -- Modern Signal launches a redesigned website for The NALP Foundation for Law Career Research and Education, a nonprofit organization that works to ensure that the legal community and society at large have a reliable, objective, and affordable source of information.The site includes a content management system; bookstore; and news, events, leadership, and products tools to manage the featured homepage content. -View-
April 5, 2010 --
|
||||
Posted on March 8, 2010 7:15:14 PM EST by David Hammond