Skip to content

COLDBOX-1452 Fix Bootstrap.cfc failing to compile on Adobe ColdFusion (appHash property default) - #703

Closed
homestar9 wants to merge 1 commit into
ColdBox:developmentfrom
homestar9:fix/bootstrap-apphash-adobe
Closed

homestar9 wants to merge 1 commit into
ColdBox:developmentfrom
homestar9:fix/bootstrap-apphash-adobe

Conversation

@homestar9

@homestar9 homestar9 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

ColdBox 8.2.0 fails to start on Adobe ColdFusion. Bootstrap.cfc does not compile, and every app fails on its first request with:

Expression in cfproperty value must have a constant value.

The cause is this line, added in d3963c4 ("Set default value for appHash property"):

property name="appHash" default="#getBaseTemplatePath()#";

Adobe ColdFusion only allows constant values, such as strings or numbers, as a property default. A function call is not allowed, so Adobe rejects the whole component. Lucee and BoxLang accept it.

The fix

  • Remove the default from the appHash property.
  • Set appHash with a component-level param, next to the other params:
param name="appHash" default="#hash( getBaseTemplatePath() & application.applicationname )#";

This keeps the goal of the fix for #668. The component-level code runs when the Bootstrap is created, so appHash already exists when reloadChecks() uses it, even if loadColdBox() has not run yet. The value is the same one loadColdBox() sets, so its existing assignment still works unchanged.

Why CI did not catch it

The test suite starts ColdBox through coldbox.system.testing.VirtualApp, not Bootstrap.cfc, so no test ever compiled Bootstrap.cfc. The workflow does load /test-harness, which uses Bootstrap.cfc, but that curl call doesn't use --fail, so an error page there does not fail the job.

Tests

Added tests/specs/BootstrapTest.cfc. It creates a Bootstrap without calling loadColdBox() and checks:

  1. The component can be created. On Adobe this fails if a non-constant property default is added again.
  2. getAppHash() already returns the expected hash. This covers the But on app hash param #668 case.

Results on Adobe ColdFusion 2023.0.24.330957 (Java 17):

Code Result
development without this fix 2 errors: "Expression in cfproperty value must have a constant value."
With this fix 2 passed

I also reproduced the original startup error in a small ColdBox app on Adobe 2023.0.24, with both Java 17 and Java 21. With the fix, that app starts correctly in three cases: when reloadChecks() runs before loadColdBox(), after a ?fwreinit=1 reload, and with the normal onApplicationStart() → loadColdbox() startup.

I did not run the full suite locally, and I have not tested on Lucee or BoxLang. The fix only uses a plain param, which those engines already support.

Jira Issues

https://ortussolutions.atlassian.net/browse/COLDBOX-1452

Bug Tracker: https://ortussolutions.atlassian.net/jira/software/c/projects/COLDBOX/issues

Type of change

  • Bug Fix

Checklist

  • My code follows the style guidelines of this project cfformat (the lines I changed match cfformat; Bootstrap.cfc already had two unrelated lines that don't, and I left them alone)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (not needed)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (only the new spec was run locally)

Adobe ColdFusion only allows constant values as a property default.
The appHash property used default="#getBaseTemplatePath()#", so Adobe
refused to compile Bootstrap.cfc and every app failed on startup with
"Expression in cfproperty value must have a constant value."

Remove the property default and set appHash with a component-level
param instead, next to the other params. The value still exists before
reloadChecks() runs, which was the goal of the fix for ColdBox#668.

Add a spec that creates a Bootstrap without calling loadColdBox(). The
test suite starts ColdBox through VirtualApp, so no existing test ever
compiled Bootstrap.cfc.
@homestar9 homestar9 changed the title Fix Bootstrap.cfc failing to compile on Adobe ColdFusion (appHash property default) COLDBOX-1452 Fix Bootstrap.cfc failing to compile on Adobe ColdFusion (appHash property default) Sep 23, 2026
@homestar9
homestar9 marked this pull request as ready for review September 23, 2026 19:54
Copilot AI lite review requested due to automatic review settings September 23, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified, and regression coverage addresses the startup failure.

Review effort: Lite
Findings: None

What changed in this PR

Fixes Adobe ColdFusion startup failures by moving appHash initialization to component-level runtime code and adding regression coverage.

Changes:

  • Removes the non-constant appHash property default.
  • Initializes appHash before reload checks.
  • Adds Bootstrap creation and hash initialization tests.
File Description
tests/​specs/​BootstrapTest.cfc Adds regression coverage for Bootstrap creation and early hash availability.
system/​Bootstrap.cfc Adjusts appHash initialization for Adobe ColdFusion compatibility.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lmajano lmajano closed this Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants