Skip to content

templates: escape the authored field label into every Harmonia JS/Alpine interpolation (#7294) - #7314

Merged
delchev merged 1 commit into
eclipse-dirigible:masterfrom
nedelcho-delchev-tues:issue-7294-widgetlabel-js-escape
Sep 11, 2026
Merged

templates: escape the authored field label into every Harmonia JS/Alpine interpolation (#7294)#7314
delchev merged 1 commit into
eclipse-dirigible:masterfrom
nedelcho-delchev-tues:issue-7294-widgetlabel-js-escape

Conversation

@nedelcho-delchev-tues

Copy link
Copy Markdown
Contributor

Summary

Same defect class as #7205/#7206/#7207: an authored string - this time the field label: (#6424, widgetLabel) - was interpolated verbatim into single-quoted JS string literals and Alpine T() call arguments across the Harmonia templates.

  • label: "Owner's copy" closes the literal early: the report page's column list becomes a syntax error (blank page), and in the form/master/list/document views the apostrophe ends the T() fallback argument inside an Alpine x-text expression, throwing at evaluation and aborting the walk of the enclosing element.
  • Resolve a widgetLabelJs (JsLiterals.escape(widgetLabel)) once in ModelParameterProcessor, the same way widgetPatternJs/dataDefaultValueJsLiteral already are, and route every JS-string/Alpine-expression interpolation of the label through it: the my/partner/main form and document views, the list/master/report page+view templates, and the item-dialog's detail-register.
  • Plain HTML text content (the report table header, table-view.html.template) is left untouched - an apostrophe there is harmless (no HTML escaping needed for ' in text content, and this issue is scoped to the JS/Alpine interpolation defect).

Test plan

  • mvn -pl components/ide/ide-template -am testJsLiteralsTest/ModelParameterProcessorTest and the rest of the module, 143/143 green
  • New IntentEngineIT test (an_authored_label_is_escaped_into_every_harmonia_interpolation) declaring a field with label: "Owner's copy" and asserting the escaped literal reaches the form, the master page and the item-dialog register — and the raw, unescaped apostrophe never does
  • Full IntentEngineIT class — 78/78, no regressions from the template edits
  • mvn formatter:validate (repo-wide) — BUILD SUCCESS

Fixes #7294

🤖 Generated with Claude Code

…ine interpolation (eclipse-dirigible#7294)

Same defect class as eclipse-dirigible#7205/eclipse-dirigible#7206/eclipse-dirigible#7207: an authored string (this time the field
`label:`, eclipse-dirigible#6424) was interpolated verbatim into single-quoted JS string literals
and Alpine T() call arguments across the Harmonia templates. `label: "Owner's
copy"` closed the literal early - the report page's column list became a syntax
error (blank page), and in the form/master/list/document views the apostrophe
ended the T() fallback argument inside an Alpine x-text expression, throwing at
evaluation and aborting the walk of the enclosing element.

Resolve a `widgetLabelJs` (JsLiterals.escape(widgetLabel)) once in
ModelParameterProcessor, the same way widgetPatternJs/dataDefaultValueJsLiteral
already are, and route every JS-string/Alpine-expression interpolation of the
label through it: the my/partner/main form and document views, the list/master/
report page+view templates, and the item-dialog's detail-register. Plain HTML
text content (the report table header) is untouched - an apostrophe there is
harmless.

Verified: ide-template unit tests (JsLiteralsTest, ModelParameterProcessorTest,
143/143); a new IntentEngineIT test declaring an apostrophe-carrying label and
asserting the escaped literal reaches the form, master page and item-dialog
register (and never the raw apostrophe); the full IntentEngineIT class (78/78,
no regressions); repo-wide `mvn formatter:validate` (BUILD SUCCESS).

Fixes eclipse-dirigible#7294

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@delchev
delchev merged commit 72e7d1d into eclipse-dirigible:master Sep 11, 2026
10 checks passed
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.

templates: an authored field label: is written raw into the Harmonia report JS and the form T() fallback - an apostrophe blanks the page (#7207 class)

2 participants