Commit 181cb6d
fix: anchor app-template rootPath to GetCurrentTemplatePath for subfolder stability (#3244)
The application template set `this.wheels.rootPath` from
`GetDirectoryFromPath(GetBaseTemplatePath())` — the directory of whatever file
was originally requested. When a request bootstraps under a subfolder (e.g. the
web test runner), the base template is not the public front controller, so
rootPath mis-anchors. Because rootPath seeds `this.name` via `Hash(rootPath)`
(the issue-359 shared-app-name pattern), an unstable value silently splits one
app across two application scopes — a contributor to the "reload=true fixes it"
symptom in #3025/#2887.
Anchor to `GetCurrentTemplatePath()` instead — always this Application.cfc's own
path (the public dir), stable regardless of the requested base template. The
value is identical for a normal front-controller request, so existing apps that
uncommented `Hash(rootPath)` keep the same app name. (Deliberately not the
reporter's `dir & "../"` form, which would shift the value to the app root and
change that hash for every existing user — stability, not level, is the fix.)
Same idiom already used two lines down in rocketunit_tests/Application.cfc for
`this.webrootDir`.
Applied to the `wheels new` scaffold, the demo app, both examples, and the
legacy test app. Validated: demo app reload/boot clean; onboarding harness
(wheels new -> start -> migrate -> generate -> test) green (45/0).
Refs #3025, #2887
Signed-off-by: Peter Amiri <petera@pai.com>
Co-authored-by: Peter Amiri <petera@pai.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 944f458 commit 181cb6d
6 files changed
Lines changed: 30 additions & 5 deletions
File tree
- changelog.d
- cli/lucli/templates/app/public
- examples
- starter-app/public
- tweet/public
- public
- vendor/wheels/rocketunit_tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
6 | 15 | | |
7 | 16 | | |
8 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
0 commit comments