We're updating the issue view to help you get more done. 

GetBaseTemplatePath() errors in JSR-223 context

Description

When calling the getBaseTemplatePath() function from JSR-223 (in a CommandBox task runner, for example) an error is thrown:

1 current context does not have a template it is based on

I get that is technically correct but this makes some CFML modules impossible to use from the CLI if they use that method and there's no good way to test if the method will work or not other than just wrapping it in a try/catch. I noticed that the cgi.script_name is spoofed to just show /index.cfm from JSR-223. Can this function return the same spoofed path? Or, even better, return the first included file. For instance, all of CommandBox runs inside of a Bootstrap.cfm file which would be a logical response from that function.

Related bug in MockData.cfc library which won't work inside CommandBox currently:
https://github.com/Ortus-Solutions/MockDataCFC/pull/3/files#diff-b5c2bad68f4807cad3b65e1b4831d9afL112

Environment

Status

Assignee

Michael Offner

Reporter

Brad Wood

Sprint

None

Fix versions

Priority

Blocker