There are 3 updates, 1 comment.
 
 
Release Notes Application / cid:jira-generated-image-avatar-e92de929-43f5-48f8-ae85-5656e540d8f7 RN-79 Open

The release note template page displays raw Velocity code as its title

 
View issue   ยท   Add comment
 

3 updates

 
cid:jira-generated-image-avatar-a2eb99b9-859c-4bbb-be1e-33ec129c0722 Changes by Vincent Massol on 30/Aug/26 12:41
 
Description: h2. Problem

{{ReleaseNotes.Code.ReleaseNoteTemplate}} carries a dynamic title, {{Release Notes for $doc.getValue('product') $doc.getValue('version')}}, which
is handed {{HomeReleaseNotes}} copies to every release note created from the application home page. On a created release note that title resolves, because the page holds a {{ReleaseNoteClass}} xobject with a {{product}} and a {{version}}. That design is sound and is kept.

The template page itself holds no such xobject, so
on that page neither reference resolves and Velocity leaves them as literal text. Wherever the raw script is what the user is shown wherever the template page is displayed by its title , the user is shown the raw script instead of a name :

* in the "Template Reference" page picker of the wiki administration (Administration > Other > Release Notes), which is exactly where an administrator is asked to pick that page
* on the template page itself, in its breadcrumb, in search results and in the document index

h2.
Why the obvious fix does not work Proposal

Adding a fallback to Give the title ( a fallback for instance the case where the page has no release note xobject, the same idiom {{ ReleaseNotes.Code.Change.ChangeSheet}} already uses:

{code:none}
#if ("$!doc.getValue('product')" != '') Release Notes for $doc . getValue('product') $doc . . getValue('version') #{else}Release Note Template#end
{code
}

The template page then reads "Release Note Template", while release notes created from it keep their dynamic title unchanged.

h2. Note for whoever tests this

{{ReleaseNotesIT#createReleaseNoteFromTemplate
} ) fixes } used to flatten the display but breaks template title before creating the created release notes note , which then all come makes the fix above look broken (every created release note comes out titled "Release Note Template" ) .

The
reason cause is that in the test helper, not in the application: the REST API fills {{ HomeReleaseNotes Page#title }} copies with the *rendered* title with ( {{ $rnDoc ModelFactory}} does {{pageSummary .setTitle( $templateDoc doc . title getDisplayTitle( ) ) }} , ) and a document title is evaluated against the page holding , on save, stores whatever it : what the template hands over is therefore *already rendered* against the template page, which has no release note xobject. The dynamic title only ever survived that copy because an unresolved Velocity reference renders given as its own source text, so the rendered title happened to be identical to the raw one. That accident is the very thing that makes the template page display the script. Using 's raw title ( {{ $templateDoc doc . setTitle(restPage. getTitle() ) }} instead of {{$templateDoc ) . So a plain REST get/save round-trip on a page whose title }} makes no difference holds Velocity silently replaces that title with its rendered form .

h2. Proposal

Stop routing
The helper that turns required rights on for the release note title through the template title:

* title the created release note from the product and the version it is created for, which is
did exactly what that. It now clears the dynamic title resolved to anyway before saving , and put so that string in the {{ReleaseNotes stored one is left alone . Code.Translations}} bundle
* give the template page the plain title "Release Note Template"

Note that this makes the release note title static: editing the {{product}} or {{version}} xproperty of an existing release note afterwards no longer changes its title, and a customised template title
This is no longer used worth keeping in mind for the created release notes any other code doing a REST round-trip on a page with a scripted title .
Attachment: release-notes-template-picker.png
Attachment: release-notes-template-picker.png
 
 

1 comment

 
cid:jira-generated-image-avatar-a2eb99b9-859c-4bbb-be1e-33ec129c0722 Vincent Massol on 30/Aug/26 12:41
 

Correction to my earlier comment and to the description: the first attempt at this fix was wrong.

I had concluded that the template could not hand over its title unrendered, and changed the application to build the release note title from the product and version instead. That was based on a test artefact, not on how the application behaves. The REST API returns the rendered title in the Page#title field and stores whatever it receives as the raw title on save, so the get/save round-trip that the functional test performs on the template (to turn required rights on) was flattening the template title before the release note was created.

The application copies the title exactly as intended, so the dynamic title is kept and only a fallback is added for the template page itself. The test helper no longer touches the stored title.