> -Yes, my reading of the docs agree that if you call > -getCurrentTemplatePath() inside Application.cfm, it > should return the > -path of that Application.cfm file.
> Okay, S. Isaac seems to suggest that it misbehaves when: > An external template calls a <cfscript>-defined UDF that, > in turn, calls getCurrentTemplatePath(). It turns out that > the caller of the *UDF* has *its* path reported. He notes > that it doesn't behave this way when the UDF is defined in > <cffunction>. > I guess I'll send in a bug report, and make a note in the > livedocs (of 6.1, and CFMX7 too, if it's confirmed that it > still happens there). > Thanks for both of your replies, > Jamie Well as far as I'm aware it's been this way since the release of ColdFusion MX and I'd be surprised if they changed it in 7 -- I think it was actually intentional... the reason being that if you were to use <cfinclude> or <cfmodule> inside of a function created with the <cffunction> tag, the relative path to the included template or module must be relative to the template containing the <cffunction> tag. I personally still think getCurrentTemplatePath() should return the path to the currently executing template (instead of the function template), but I suspect relative paths for cfinclude / cfmodule have something to do with why it produces that result. At this point there's a fair amount of code in use which observes the difference, so "fixing" it would require many of us to modify our existing code to check the version of CF to determine behavior. I would be okay with that (although I might not like it), though some people might be miffed. Actually I take that back -- if by "fixing" you mean making it always return the path to the template in which the function is declared (not called), then I'd be pretty royally upset over it -- because I can't think of another way to generate that information (which is vitally important to my code) if the behavior were changed in that direction. s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://macromedia.breezecentral.com/p49777853/ http://www.sys-con.com/author/?id=4806 http://www.fusiontap.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202511 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54